web.xml <error-page> doesn't work on -JBoss3.0+tomcat?

Discussions

Web tier: servlets, JSP, Web frameworks: web.xml <error-page> doesn't work on -JBoss3.0+tomcat?

  1. Hi all,
    I added the error handling configuration in the web.xml of my application, something like this:
       <error-page>
    <error-code>500</error-code>
    <location>/error-page.jsp</location>
       </error-page>
       <error-page>
    <exception-type>javax.servlet.ServletException</exception-type>
    <location>/error-page.jsp</location>
       </error-page>
    However the ServletException errors are still being displayed in the default error page of Tomcat.

    I use JBoss 3.0+Tomcat and Struts framework.
    some Action Servlets throw an ServletException that is displayed on the default error page of tomcat when an error occurs. But I want it be displayed in another page(error-page.jsp). What else should I do to achieve that?

    Thanks for your comments.

    Regards
    Cesar

    Threaded Messages (2)

  2. web.xml error-codes[ Go to top ]

    This is the case with some web/application servers like Tomcat,Orion,Resin,Jboss,Oracle application server. some of these servers have their own way of implementing this functionality.

    But,this functionality works well in IBM WebSphere and WebLogic.
  3. web.xml error-codes[ Go to top ]

    You can try out with this,it does fine in my Jboss-tomcat

    <error-page>
    <error-code>404</error-code>
    <location>/error.jsp</location>
    </error-page>