I am writing a servlet, in that if any exception occurs i donэt want to display exception/error message on browser, so I will redirect to my customized error page. So I have
One way to handle it in a generic way is to use web.xml like below:
java.io.IOException
/ErrorHandler
I have just included IO exception but you might have say SQLException you could very well add another error-page and another location for the same. Similarly you could say java.lang.Exception type and one handler handling everything.