I am working on an application in J2EE, Spring mvc.
Application has two themes. If java.lang.Exception comes it is handled.
I configure error page in web.xml as:
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/WEB-INF/jsp/uncaughtException.jsp</location>
</error-page>
Each time in any theme uncaughtException.jsp is displayed. I want to show different page for different themes.
I did the following work around in order to show different message for different exception I think this trick can help you.
I’just redirecting on exception with different message each time and show this message on the same page.
Update:
You can also use
SimpleMappingExceptionResolverit might be more useful in your case:you can just map each exception to each page and the the default page.