4 Replies Latest reply on May 31, 2004 1:15 PM by treespace

    Default page not found when precompiled

      I am using JBoss 3.2.3 with the tomcat configuration. I have a default page called sentry.jsp that shows up without an explicit reference. That is expected since it is listed in the welcome-file-list of web.xml.

      After precompiling as servlets, sentry.jsp gets mapped to /sentry.jsp and no longer shows up as the default page. It does show up if you specify an explicit reference to the page: http://acme.com/sentry.jsp.

      I tried adding a foward slash in front of sentry.jsp in the welcome-file but that did not work at all. Obviously not a show stopper since I can always type in the name of the page but why would it stop working as the default after precompiling it as a servlet?

      All ideas welcome,

      TIA


        • 1. Re: Default page not found when precompiled
          ironbird

          Your precompiled jsp page must be mapped as a servlet with a "/" as url-pattern.
          Use <jsp-page> instead of <servlet-class> in the declaration.

          • 2. Re: Default page not found when precompiled

            To reiterate, JspC generates the mappings with the leading slash. That works fine except for the isolated problem with the welcome file. When compiled as a servlet, the welcome file no longer shows up by default. You have to exlicitly enter the name of the URL. I will try using <jsp-page> with that file but it is in fact a servlet now. Is this a known problem with entries in the welcome-file-list under tomcat?

            • 3. Re: Default page not found when precompiled

              Found the problem.

              You cannot use a Servlet in the welcome-file-list of web.xml.

              This "flaw" is fixed in Tomcat 5.0 but 3.2.3 uses Tomcat 4.1. In 5.0 you can add the name of the servlet (not the mapping, the name) as a welcome file in your welcome file list. Meanwhile we will just leave that page as a loose JSP page.

              • 4. Re: Default page not found when precompiled

                Clarification: the "flaw" is of course fixed in the JSP specification 2.0 that TC 5.0 will use versus 1.2 currently in use. BTW, TC 5.0 is following the path JBoss took with JMX management. Looking forward to that release.