2 Replies Latest reply on Mar 6, 2008 4:38 PM by hack3d

    web.xml

    hack3d

      Version: JBoss4.0.5GA
      I'm using static HTML error pages for redirecting any errors to a customized error page. For some reason, the JBoss is not redirecting to the static pages, rather showing the default HTTP error message. Also, I'm using BASIC authentication, instead of FORM based authentication.
      The following code is part of my web.xml file.

      <login-config>
      <auth-method>BASIC</auth-method>
      <realm-name>backoffice</realm-name>

      </login-config>

      <!-- static error HTML pages -->
      <!-- HTML errors: 400,401,403,404,408,500,503,505,508 -->
      <!-- start here -->
      <error-page>
      <error-code> 404 </error-code>
      /error/error404.html
      </error-page>
      <error-page>
      <error-code> 401 </error-code>
      /error/error401.jsp
      </error-page>
      <error-page>
      <error-code> 400 </error-code>
      /error/error400.html
      </error-page>
      <error-code> 500 </error-code>
      /error/error500.html
      </error-page>
      <error-page>
      <error-code> 505 </error-code>
      /error/error505.html
      </error-page>

      <!-- end here -->
      <welcome-file-list>
      <welcome-file>index.jsp</welcome-file>
      </welcome-file-list>

      </web-app>

        • 1. Re: web.xml
          peterj

          Try getting rid of the spaces around the error codes. (I have noticed other places where white space seems to cause problems.)

          Also, when posting xml text, please surround with code brackets (select text and hit the Code button).

          • 2. Re: web.xml
            hack3d

            Actually, that does not work either. After three login attempts, it basically change the URL to http://localhost:8080/something/index.faces
            rather it should change it to
            http://localhost:8080/something/error/error401.html
            If I manually try to access this URL, it works. This sort of error could be the redirection that is not taking place. Any thoughts ?
            The modified code is pasted below

            <security-role>
            <role-name>BackofficeUser</role-name>
            </security-role>

            <login-config>
            <auth-method>BASIC</auth-method>
            <realm-name>backoffice</realm-name>

            </login-config>

            <!-- static error HTML pages -->
            <!-- HTML errors: 400,401,403,404,408,500,503,505,508 -->
            <!-- start here -->
            <error-page>
            <error-code>404</error-code>
            /error/error404.html
            </error-page>
            <error-page>
            <error-code>401</error-code>
            /error/error401.html
            </error-page>
            <error-page>
            <error-code>400</error-code>
            /error/error400.html
            </error-page>
            <error-page>
            <error-code>403</error-code>
            /error/error403.html
            </error-page>
            <error-page>
            <error-code>408</error-code>
            /error/error408.html
            </error-page>
            <error-page>
            <error-code>503</error-code>
            /error/error503.html
            </error-page>
            <error-page>
            <error-code>500</error-code>
            /error/error500.html
            </error-page>
            <error-page>
            <error-code>505</error-code>
            /error/error505.html
            </error-page>

            <!-- end here -->
            <welcome-file-list>
            <welcome-file>index.jsp</welcome-file>
            </welcome-file-list>

            </web-app>