Bear Bibeault wrote:Generally, exceptions in servlets should not be caught and just let propagate outward to the container where an error handler that you establish in the deployment descriptor can handle them in a consistent fashion.
Errors in script I usually handle differently, because they are simply so very different in nature, but you can always make script errors emit that same type of output as your server-side error handler for consistency.
Thanks. I think that you are referring to using the error codes like so:
I still would like to know how to indicate errors with specific error numbers. Also, for the case when the session is null, in all my servlets, I have to write if session is null then ...
That's the main thing that should be fixed.
Also, one concern is that what if the user made a change while not knowing that the session was expired, then he clicked save. You do not want to automatically redirect. Instead, you want to open a pop up dialog and ask them to login again; just like an email service.
Anyways, please continue to elaborate.