4 Replies Latest reply on Sep 16, 2010 9:53 AM by mg123

    default page for url directories

    mg123

      Hi,

      I'm using Jboss ver 4.2.3 for windows and I'm trying to figure out how to provide a default landing page for url directories:

      In my web.xml file I have the following:

       

      <welcome-file-list>

      <welcome-file>/redirect.jsp</welcome-file>

      </welcome-file-list>

       

      redirect.jsp simply redirects to index.htm (which doesn't physically exist, but is the mapping configured for the servlet) and if I go to my domain

      like  my.com it redirects me to my.com/index.htm - which is what I want, but

       

      if type my.com/tools/ then it gives me "page not found" and I want it to redirect to my.com/tools/index.htm

       

      is there a way to configure it in JBoss?

       

              Thanks Michael

       

        • 1. Re: default page for url directories
          jfclere

          <welcome-file>/redirect.jsp</welcome-file>

          should be:

          <welcome-file>redirect.jsp</welcome-file>

          • 2. Re: default page for url directories
            mg123

            that didn't make a difference,  <welcome-file> is only used for the original domain request (my.com), but doesn't seem to matter for other directories like my.com/tools

            • 3. Re: default page for url directories
              jaikiran

              Michael Gaitsg wrote:

              but

               

              if type my.com/tools/ then it gives me "page not found" and I want it to redirect to my.com/tools/index.htm

               

              is there a way to configure it in JBoss?

               

              So, I guess, you want to configure a custom error page for error 404. Add a error-page element in your web.xml:

               

              <error-page>
                     <error-code>404</error-code>
                     <location>/tools/index.htm</location>
                <error-page>
              
              

               

              Check the xsd of web.xml for more details.

              • 4. Re: default page for url directories
                mg123

                Hi,

                not exactly, I alreaady have error-code configured

                it's not just one "tools" dir that I have, I have multiple  tools/, research/, reviews/, etc...

                 

                there should be a way to configure it simialr to apache, tomcat where you specify default landing page like .htm, .html, .jsp ....

                 

                I just can not figure out how to do it jboss