6 Replies Latest reply on May 24, 2013 7:35 AM by Thomas Zlika

    Custom error pages not (always) working with JBoss AS 7.1.1

    Thomas Zlika Newbie

      Hi everybody,

       

      I have a JAX-RS application deployed on JBoss AS 7.1.1.

      In the web.xml file I configured custom error pages:

       

      <error-page>

        <error-code>404</error-code>

        <location>/error.jsp</location>

      </error-page>

      <error-page>

        <error-code>500</error-code>

        <location>/error.jsp</location>

      </error-page>

       

      It's working ok for 404 (not found) errors. However, for 500 (internal server error), it doesn't work as expected:

      • if my method throws an Exception, then my custom error page is displayed
      • however, if I use in my method return Response.serverError.build() or return Response.status(500).build() then the default JBoss error page is displayed instead of my custom one!

       

      How can I fix this? Thank you for your answers.