views:

225

answers:

1

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. *

A: 

<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

Teja Kantamneni
Thanks.. if i want to catch all 400's then how is the configuration? Should i write separate error-page entries for all ?
coder247
Yes, you have to write separate entries.
Teja Kantamneni
Is there any way to get the stack trace from the servlet ? for sending a mail with the details...
coder247