coder247 coder247 - 7 months ago 28
Java Question

multiple error-code configuration web.xml

I'd like to direct all errors to my Errorsevlet without specifying all the codes explicitly. Is there any way to do like that?

<error-page>
<error-code>400</error-code>
<location>/servlet/com.abc.servlet.ErrorServlet</location>
</error-page>


*And after reaching the ErrorServlet how can i get the stack trace of the error in the servlet. So that i can email the details when one error occurs. *

Answer
<error-page>
    <exception-type>java.lang.Throwable</exception-type> 
    <location>/servlet/com.ibm.eisa.servlet.ErrorServlet</location> 
</error-page>

Try this one, all of your errors will be caught(500's) not 404 etc

Comments