I am using Java and JSP to develop my web application.
There are many situations in which user input cause an exception on server side, in this situation user expects an error message to be shown. There are several ways that I (as a programmer) can handle the transfer of the error message from server to GUI(html) and maybe redirect to other pages and show the message there. One way to go is using session attribute, other can be ajax method calls and showing the response text. There may be other ways that I don't know. Would you tell me what is the most straight forward and standard way (if there is a standard say about this)?
The problem that made me think about this was when I was trying to show the response of an ajax call in a colorbox, and I failed, it would be appreciated if you give me a hint on this too, how can I pass the response text of an ajax method in other web page.