Discussion:
Error Handling
(too old to reply)
j***@usmint.treas.gov
2006-11-03 22:15:47 UTC
Permalink
I am coming from a Tomcat world where creating an error page for exception types is as easy as adding the following to the web.xml file:

<error-page>
<error-code>500</error-code>
<location>/servlet/ExceptionHandlerServlet</location>
</error-page>

If I want to create custom error pages in WAS do I do it the same way (updating the \workspace\Stores\Web Content\WEB-INF\web.xml file) or is there an Websphere specific way of doing this (such as through an interface)?

Thanks,
Jim
Brian Lima
2006-11-06 18:19:47 UTC
Permalink
Post by j***@usmint.treas.gov
<error-page>
<error-code>500</error-code>
<location>/servlet/ExceptionHandlerServlet</location>
</error-page>
If I want to create custom error pages in WAS do I do it the same way (updating the \workspace\Stores\Web Content\WEB-INF\web.xml file) or is there an Websphere specific way of doing this (such as through an interface)?
Thanks,
Jim
Yes you should be able to edit the web.xml file in that way. It is also
possible to use the Web deployment descriptor editor in WSAD/RAD to add
error pages.
geo
2006-11-06 18:34:30 UTC
Permalink
Short answer. Yes.

<error-page>
<error-code>500</error-code>
<location>/servlet/ErrorPage</location>
</error-page>

You can also create these mappings for exception types, as well.

<error-page>
<exception-type>java.lang.ArrayIndexOutOfBoundsException</exception-type>
<location>servlet/ExceptionErrorPage</location>
</error-page>
Post by j***@usmint.treas.gov
I am coming from a Tomcat world where creating an error page for exception
<error-page>
<error-code>500</error-code>
<location>/servlet/ExceptionHandlerServlet</location>
</error-page>
If I want to create custom error pages in WAS do I do it the same way
(updating the \workspace\Stores\Web Content\WEB-INF\web.xml file) or is
there an Websphere specific way of doing this (such as through an
interface)?
Thanks,
Jim
Loading...