glassfish
  1. glassfish
  2. GLASSFISH-17413

catalina DefaultServlet path mapping different from Tomcat when servlet-mapping in subdirectory

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: v3.0.1
    • Fix Version/s: 3.1.2_b06
    • Component/s: web_container
    • Labels:
      None
    • Environment:

      Windows XP, Java 1.6.0_24

      Description

      When I try the following servlet-mapping in Tomcat 6 and Glassfish 3.0.1, the behaviour is different:

      <servlet>
      <servlet-name>default</servlet-name>
      <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
      </servlet>

      <servlet-mapping>
      <servlet-name>default</servlet-name>
      <url-pattern>/static/*</url-pattern>
      </servlet-mapping>

      Tomcat serves a resource static/foo.js at URL static/foo.js , but in Glassfish it is served at static/static/foo.js .
      According to http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/catalina/servlets/DefaultServlet.html the Glassfish behaviour is broken.

        Activity

        Hide
        Shing Wai Chan added a comment -

        fix in 3.1.2:
        Sending servlets/DefaultServlet.java
        Transmitting file data .
        Committed revision 50241.

        fix in trunk:
        Sending DefaultServlet.java
        Transmitting file data .
        Committed revision 50243.

        add test case:
        Sending build.xml
        Adding defaultServletWithSubdirectoryMapping
        Adding defaultServletWithSubdirectoryMapping/WebTest.java
        Adding defaultServletWithSubdirectoryMapping/build.properties
        Adding defaultServletWithSubdirectoryMapping/build.xml
        Adding defaultServletWithSubdirectoryMapping/descriptor
        Adding defaultServletWithSubdirectoryMapping/descriptor/web.xml
        Adding defaultServletWithSubdirectoryMapping/docroot
        Adding defaultServletWithSubdirectoryMapping/docroot/index.jsp
        Adding defaultServletWithSubdirectoryMapping/docroot/static
        Adding defaultServletWithSubdirectoryMapping/docroot/static/test.txt
        Transmitting file data .......
        Committed revision 50244.

        Show
        Shing Wai Chan added a comment - fix in 3.1.2: Sending servlets/DefaultServlet.java Transmitting file data . Committed revision 50241. fix in trunk: Sending DefaultServlet.java Transmitting file data . Committed revision 50243. add test case: Sending build.xml Adding defaultServletWithSubdirectoryMapping Adding defaultServletWithSubdirectoryMapping/WebTest.java Adding defaultServletWithSubdirectoryMapping/build.properties Adding defaultServletWithSubdirectoryMapping/build.xml Adding defaultServletWithSubdirectoryMapping/descriptor Adding defaultServletWithSubdirectoryMapping/descriptor/web.xml Adding defaultServletWithSubdirectoryMapping/docroot Adding defaultServletWithSubdirectoryMapping/docroot/index.jsp Adding defaultServletWithSubdirectoryMapping/docroot/static Adding defaultServletWithSubdirectoryMapping/docroot/static/test.txt Transmitting file data ....... Committed revision 50244.

          People

          • Assignee:
            Shing Wai Chan
            Reporter:
            hstoerr
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: