1 Reply Latest reply on Sep 21, 2002 7:46 AM by Greg Wilkins

    Tomcat/Jetty difference in welcome-file-list processing

    RogerN Newbie

      My application 'myapp' deploys with a file called 'index.jsp' in the application's root directory.

      The 'web.xml' contains:

      <welcome-file-list>
      <welcome-file>index.jsp</welcome-file>
      </welcome-file-list>

      I have a filter that intercepts all requests to the application and if the user isn't authenticated and redirects to an a URL for validation:


      <filter-name>Security Filter</filter-name>
      <filter-class>xxx.myapp.servlet.SecurityFilter</filter-class>
      <init-param>
      <param-name>logonForm</param-name>
      <param-value>/myapp/jsp/security/logon.jsp</param-value>
      </init-param>
      <init-param>
      <param-name>errorForm</param-name>
      <param-value>/myapp/jsp/security/error.jsp</param-value>
      </init-param>


      <filter-mapping>
      <filter-name>Security Filter</filter-name>
      <url-pattern>*.jsp</url-pattern>
      </filter-mapping>

      <filter-mapping>
      <filter-name>Security Filter</filter-name>
      <url-pattern>*.do</url-pattern>
      </filter-mapping>

      The filter lets requests to the 'security' directory above pass through as unfiltered.

      I use the Url: http://localhost:8080/myapp/ to get to my app and after being redirect to the logon form I expect to land on index.jsp.

      This application works without issue under Tomcat 4.*.
      Under Jetty(Jboss 3.0.2) this application brings up a blank page without ever redirecting to the logon page. To get it to work under Jetty I need to http://localhost:8080/myapp/index.jsp

      My 2 cents:
      I don't think a response like 'not defined in the spec' is a suitable response. Tomcat is the reference implementation and I would expect Jetty to follow Tomcat when gray areas in the spec exist. Besides, in this case the behavior seems logical.




        • 1. Re: Tomcat/Jetty difference in welcome-file-list processing
          Greg Wilkins Newbie


          The bad news is that this is not defined in the spec.
          The good news is that because I could not get JSR154 to agree
          to how welcome files should be handled, we have recently implemented
          a change so that we support the same behaviour as tomcat.

          The problem is that we use RequestDispatcher.forward to access
          the welcome file, while the latest versoions of tomcat uses a redirect.
          Earlier versions use something like a forward, but that does not match
          the spec either.

          In the 2.3 spec, filters do not apply to request dispatcher filters.

          But since Jetty-4.1.0RC6, which has gone into JBoss 3.2.0b
          you can set the redirectWelcome initParam on the default servlet to
          achieve the same behaviour.