mardi 21 juillet 2015

Configuring an error page in tomcat for multiple web apps

I have multiple webapps deployed on tomcat. I have configured error page in $CATALINA_BASE/conf/web.xml :

<error-page>
        <exception-type>java.lang.Throwable</exception-type>
        <location>/error.jsp</location>
</error-page>

My requirement is to create only one error.jsp page that can be accessed by all the webapps. But when I create an error.jsp page and put it in $CATALINA_BASE/error.jsp location, my webapps are not able to access it when an exception occurs say ArithmeticException. It redirects to a blank page instead.

The only way I could access the error page is by creating an individual error page for each application and put it in respective WEB_INF folder. But I want only one error.jsp file that can be shared by multiple webapps. Is it possible?

Aucun commentaire:

Enregistrer un commentaire