I am writing the servlet , in case of exception I am redirecting to my customized error page for that i have done like this.
In web.xml
You have handled the Exception
in your doPost()
using ,
try{
//Here is all code stuff
Throw new Exception();
}catch(Exception e){
e1.printStackTrace();
}
try
and catch
blocks. so the errorPage.jsp
will not be invoked.
is invoked for unhandled exceptions
A nice example tutorial Exception Handling
Read for more info Best practice error handling in JSP Servlets