3 Replies Latest reply on Mar 5, 2009 6:53 PM by rudyamid

    Setting Default Error Pages

    mduffy_lists

      I can set the default error pages in the web.xml for a specific app; however, I cannot discover how to set default error pages for root.

      I tried setting values in /opt/jboss-5.0.0.GA/server/default/deploy/ROOT.war/WEB-INF/web.xml; this did not work.

      For the HTTP Status 404 error (resource not available), I would like to forward users my own page when they mistype a URL rather then having them sent to the generic JBoss page.

      Thx.

      Mike

        • 1. Re: Setting Default Error Pages
          peterj

          Try server/default/deployers/jbossweb.deployer/web.xml

          • 2. Re: Setting Default Error Pages
            mduffy_lists

            Here's the solution:

            Edit the web.xml in
            /opt/jboss-5.0.0.GA/server/default/deployers/jbossweb.deployer

            by adding


            <!-- 404 SC_NOT_FOUND -->

            <error-page>

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

            /error/error404.html

            </error-page>

            just after </welcome-file-list>

            Then the html and supporting files (images, css, etc.) go in
            /opt/jboss-5.0.0.GA/server/default/deploy/ROOT.war/error

            • 3. Re: Setting Default Error Pages
              rudyamid

              Works great with Firefox and Opera.

              In Internet Explorer the 404 page doesn't show up though.

              I read somewhere that if I enable "listings" in web.xml might work, but I just tried it and still doesn't work.

              Any ideas there?