1 Reply Latest reply on Jan 6, 2002 4:34 AM by adrian.brock

    Custom HTTP Status 500 Error Response

    rbottoms

      Where would I set up a custom HTTP Status 500 status error response page(s). I want to deploy/remove applications as needed. Users should then receive a special page or be redirected if the app is missing.


      Thanks,
      r.b.

        • 1. Re: Custom HTTP Status 500 Error Response

          Here is one solution.

          1) Create a "root" deployment.
          There already is one in catalina/webapps/ROOT

          2) Add the error page
          In that folder create error.html

          3) in WEB-INF/web-xml add the line
          <error-page><error-code>404</error-code>/error.html</error-page>
          Choose error codes to suite. With the root context present you will now get 404 instead of 500 for
          missing deployments.

          4) Deployment
          In the folder
          jar cf .war *
          this is a trick (no prefix means it is deployed as "/")
          Copy .war into jboss/deploy
          You should now have the jakarta example page and a 404
          error page.

          NOTE: If you deploy something else e.g.
          tomcat-test.ear it will not use the error page,
          it has its own web.xml

          Regards,
          Adrian