Hi All:
My JSP/Servlet Error are not being redirected using the <error-page> Tag.
The following is my declaration of Error Pages in my web.xml
<web-app
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
<error-page>
<error-code>404</error-code>
<location>/errorPage.jsp</location>
</error-page>
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/errorPage.jsp</location>
</error-page>
If I do <%@ page errorPage="/errorPage.jsp"%> in a
JSP Page and an Exception occurs.
Tomcat correctly redirects me to the errorPage.jsp
However, if I omit the above declaration from the JSP Page, I get the following error:
Oct 30, 2006 8:39:40 PM org.apache.catalina.core.StandardHostValve custom
SEVERE: Exception Processing ErrorPage[exceptionType=java.lang.Exception, location=/errorPage.jsp]
java.lang.IllegalStateException
at org.apache.coyote.Response.reset(Response.java:296)
Is it something to do with the order of the <error-page> tag. We are told that web.xml 2.4 spec doesnt care about the order of its elements.
Any suggestions pls.
Thanks.
Chetan