struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zhang, Larry (L.)" <>
Subject configure default error page in web.xml
Date Tue, 30 Sep 2003 19:13:05 GMT

I have a request to catch a Java Exception in the servlet and display an error page. The functionality
requires that we display different error message for different exception.

A way to do this is to put try and catch logic in servlet, and if an Exception is caught,
I do request.setAttribute("javax.servlet.jsp.jspExcetion",e), and then forward to jsp error
page, where we check the type of exception implicit object. Based on this type, we display
different error message. This is fine, but we are not going to use this approach.

The other way is to configure web.xml. We can configure an error page for specific Java exception.
If the specific exception is raised to the web container, the configured error page will get
called. My question is that is there any body  doing this way successfully?


Larry Zhang

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message