10 Replies Latest reply on Dec 22, 2005 2:42 AM by nchandrasekhar_mca

    404 ERROR PAGE

    ego2002

      Hi everybody!

      I'd like to have the default 404 ERROR page as "page not found" error page, while on default there's a customizated one on JBoss Portal... Does anybody know how and where to set it?

      The problem is that I don't want the Portal answer me with a customized 404 Error page... I want a 404 HTTP error! Not a 200 OK HTTP answer with an error page... I don't know if I can explain me...

      Thanks a lot!

      Il Dima

        • 1. Re: 404 ERROR PAGE
          black78

          Hi.

          I have the same problem.
          I want to use my own error page for different error numbers and Exceptions.
          I tried to change the web.xml (lies in the WEB-INF Dir of my portal) like this:


          <?xml version="1.0" encoding="ISO-8859-1"?>
          <!DOCTYPE web-app
          PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
          "http://java.sun.com/dtd/web-app_2_3.dtd">

          <!-- $Revision: 1.3 $ -->
          <web-app>

          ....

          <!-- error mapping -->
          <error-page>
          <error-code>404</error-code>
          /404.html
          </error-page>

          <error-page>
          <error-code>500</error-code>
          /404.html
          </error-page>

          <error-page>
          <exception-type>java.lang.Exception</exception-type>
          /404.html
          </error-page>

          </web-app>


          It does not work. The standard tomcat error-page appears.
          Any idea?

          @ego2002: Have you solved the problem?

          Greetings, Black

          • 2. Re: 404 ERROR PAGE
            black78

             

            "Black78" wrote:
            Hi.

            I have the same problem.
            I want to use my own error page for different error numbers and Exceptions.
            I tried to change the web.xml (lies in the WEB-INF Dir of my portal) like this:


            <?xml version="1.0" encoding="ISO-8859-1"?>
            <!DOCTYPE web-app
            PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
            "http://java.sun.com/dtd/web-app_2_3.dtd">

            <!-- $Revision: 1.3 $ -->
            <web-app>

            ....

            <!-- error mapping -->
            <error-page>
            <error-code>404</error-code>
            &lt;location&gt;/404.html&lt;/location&gt;
            </error-page>

            <error-page>
            <error-code>500</error-code>
            <location>/404.html</location>
            </error-page>

            <error-page>
            <exception-type>java.lang.Exception</exception-type>
            <location>/404.html</location>
            </error-page>

            </web-app>


            It does not work. The standard tomcat error-page appears.
            Any idea?

            @ego2002: Have you solved the problem?

            Greetings, Black


            • 3. Re: 404 ERROR PAGE
              black78

               

              "Black78" wrote:
              "Black78" wrote:
              Hi.

              I have the same problem.
              I want to use my own error page for different error numbers and Exceptions.
              I tried to change the web.xml (lies in the WEB-INF Dir of my portal) like this:


              <?xml version="1.0" encoding="ISO-8859-1"?>
              <!DOCTYPE web-app
              PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
              "http://java.sun.com/dtd/web-app_2_3.dtd">

              <!-- $Revision: 1.3 $ -->
              <web-app>

              ....

              <!-- error mapping -->
              <error-page>
              <error-code>404</error-code>
              <location>/404.html</location>
              </error-page>

              <error-page>
              <error-code>500</error-code>
              <location>/404.html</location>
              </error-page>

              <error-page>
              <exception-type>java.lang.Exception</exception-type>
              <location>/404.html</location>
              </error-page>

              </web-app>


              It does not work. The standard tomcat error-page appears.
              Any idea?

              @ego2002: Have you solved the problem?

              Greetings, Black


              • 4. Re: 404 ERROR PAGE
                black78

                Ups. sorry for this...

                The location Tag is not shown in my Example-Code.
                No idea, why.

                Black

                • 5. Re: 404 ERROR PAGE

                  in what WAR did you place this ?
                  You need to put the entry and the page in the correct context (I think it's the portal server war; not 100% sure and I don't have the code on this machine to look ....). Anyway. Look at the Login page as an example.

                  • 6. Re: 404 ERROR PAGE
                    black78

                    The web.xml is in the same WEB-INF dir like my portal xml descriptors:
                    ***-portal.xml
                    portlet.xml
                    portlet-instances.xml

                    Ok, the LoginPortlet uses the path "/WEB-INF/jsp/user/login.jsp".
                    But my problem is, that the error-page entry is simply ignored. I get a normal tomcat error report page.

                    Black

                    • 7. Re: 404 ERROR PAGE
                      scottdawson

                      Internet Explorer will not load error pages that are smaller than 512 bytes. If you are testing with IE, try adding comments or content to the error page so that it is larger than 512 bytes.

                      Scott Dawson
                      Unisys

                      • 8. Re: 404 ERROR PAGE
                        black78

                        Thanks, but I'm not testing with IE.

                        Black

                        • 9. Re: 404 ERROR PAGE
                          nchandrasekhar_mca

                          i got 404 - Page Not Found while testing my portal

                          • 10. Re: 404 ERROR PAGE
                            nchandrasekhar_mca

                             

                            "nchandrasekhar_mca" wrote:
                            i got 404 - Page Not Found while testing my portal


                            looking forward for solution

                            with regards

                            chandra sekhar
                            nchandra.sekhar@secf.com
                            chandra_sekhar_mca@yahoo.com