2011/8/27 Donald Jolley <jolleyt...@gmail.com>:
> For days I have been playing around with trying to develop a general-purpose
> forwarding mechanism that I could use to forward to an errors page upon the
> occurrence of an exception.  It has just been revealed to me that this
> approach is not going to work because once a response is committed it is no
> longer possible to forward.  That being the case, I'd love to hear
> suggestions as to what should be done upon the occurrence of an exception.
> At a minimum, I'd like to get some basic information about the exception
> displayed.  I realize that I could just stuff that information into the
> response buffer.  It seems to me that that approach has the potential for
> being a bit crude depending upon the state of the response buffer at the
> time the exception occurred (it could be right in the middle of a table, for
> example).  Suggestions?

1. Exception handling can be configured in WEB-INF/web.xml (see spec)

2. I suggest you to look at MVC web frameworks. In short, you have a
servlet that calls your class that does all the work. After processing
you forward to a JSP page and the page is then used only to display
the result (and thus having errors there will be less probable).

My favorite one is part of the Spring framework. [1][2] There are
others as well (e.g. Struts).

[1] http://www.springsource.org/download
[2] 
http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/mvc.html

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to