Details

    • Issuezilla Id:
      3,569
    • Status Whiteboard:
      Hide

      91ur1Approved

      Show
      91ur1Approved

      Description

      Running 9.1 (build b58c-fcs) I was not able to make alternatedocroot work.

      My scenario, on a virtual host with host matching say www.example.com, adding
      the property :
      alternatedocroot_1
      with value :
      from=/data/* dir=/usr/home/data
      so that calling http://www.example.com/data/ will point to the content of
      /usr/home/data will fail returning a 404 not found.

      Expected behaviour was call to the default servlet from default-web.xml.

      Also inside a webapp, having a default servlet MetaImageServlet that inherits
      from Catalina's DefaultServlet (actually WebdavServlet) where mainly renderXml
      has been rewritten. Having the web.xml such as :

      <?xml version="1.0" encoding="UTF-8"?>
      <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
      http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

      <description>Displays Image, Video ... in a fancy way, replacing the default
      servlet</description>
      <display-name>Meta Image Show</display-name>
      <distributable/>
      <servlet>
      <servlet-name>metadata</servlet-name>
      <servlet-class>info.aide.metaimage.MetaImageServlet</servlet-class>
      <init-param>
      <param-name>debug</param-name>
      <param-value>0</param-value>
      </init-param>
      <init-param>
      <param-name>listings</param-name>
      <param-value>true</param-value>
      </init-param>
      <init-param>
      <param-name>globalXsltFile</param-name>
      <param-value>/home/admin/folder.xsl</param-value>
      </init-param>
      <init-param>
      <param-name>readmeFile</param-name>
      <param-value>readme.txt</param-value>
      </init-param>

      <init-param>
      <param-name>readonly</param-name>
      <param-value>true</param-value>
      </init-param>

      <load-on-startup>1</load-on-startup>
      </servlet>

      <servlet-mapping>
      <servlet-name>metadata</servlet-name>
      <!-- <url-pattern>/</url-pattern> -->
      <url-pattern>/*</url-pattern>
      </servlet-mapping>

      <session-config>
      <session-timeout>
      30
      </session-timeout>
      </session-config>
      <welcome-file-list>
      <welcome-file>index.jsp</welcome-file>
      </welcome-file-list>
      </web-app>

      And trying to introduce the alternate docroot to /metaimage/data/* with :
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server
      9.0 Servlet 2.5//EN"
      "http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd">
      <sun-web-app error-url="">
      <context-root>/data</context-root>
      <class-loader delegate="true"/>
      <jsp-config>
      <property name="keepgenerated" value="true">
      <description>Keep a copy of the generated servlet class' java
      code.</description>
      </property>
      </jsp-config>
      <property name="alternatedocroot_1" value="from=/image/*
      dir=/usr/home/data/image" />
      </sun-web-app>

      An HTTP GET to http://www.bugeaud.fr/metaimage/ is showing the folder content
      with the MetaImageServlet.
      But an HTTP GET to http://www.bugeaud.fr/metaimage/image/ is returning a 404 not
      found.

      According to my understanding the implementation should first try to match with
      alternative docroot expression and if so, call the default with the mapped
      file/directory as target. My exact expectation was that even in that case it
      will call my own "default servlet". But I will be satisfied too if it call the
      regular "default servlet" from the default-web.xml because the MetaImageServlet
      has been designed to replace it (maybe a contrib for GF repository once my code
      has matured).

        Activity

        Hide
        jluehe added a comment -

        Checking in DefaultServlet.java;
        /cvs/glassfish/appserv-webtier/src/java/org/apache/catalina/servlets/DefaultServlet.java,v
        <-- DefaultServlet.java
        new revision: 1.17.4.1; previous revision: 1.17
        done

        Show
        jluehe added a comment - Checking in DefaultServlet.java; /cvs/glassfish/appserv-webtier/src/java/org/apache/catalina/servlets/DefaultServlet.java,v <-- DefaultServlet.java new revision: 1.17.4.1; previous revision: 1.17 done
        Hide
        bjb added a comment -

        Hi Jan,

        Having getResourcePaths implemented looks like there should be way for me to
        implement this in a "portable" way.

        Great thanks for this feedback.

        Rgs,
        JB

        Show
        bjb added a comment - Hi Jan, Having getResourcePaths implemented looks like there should be way for me to implement this in a "portable" way. Great thanks for this feedback. Rgs, JB
        Hide
        basler added a comment -

        Targeted correct version

        Show
        basler added a comment - Targeted correct version
        Hide
        jluehe added a comment -

        Added unit test:
        /cvs/glassfish/appserv-tests/devtests/web/webappAlternateDocrootDirListing

        Show
        jluehe added a comment - Added unit test: /cvs/glassfish/appserv-tests/devtests/web/webappAlternateDocrootDirListing
        Hide
        jluehe added a comment -

        Ported fix to 9.1.1 (SJSAS91_FCS_BRANCH):

        Checking in DefaultServlet.java;
        /cvs/glassfish/appserv-webtier/src/java/org/apache/catalina/servlets/DefaultServlet.java,v
        <-- DefaultServlet.java
        new revision: 1.17.2.1; previous revision: 1.17
        done

        Show
        jluehe added a comment - Ported fix to 9.1.1 (SJSAS91_FCS_BRANCH): Checking in DefaultServlet.java; /cvs/glassfish/appserv-webtier/src/java/org/apache/catalina/servlets/DefaultServlet.java,v <-- DefaultServlet.java new revision: 1.17.2.1; previous revision: 1.17 done

          People

          • Assignee:
            jluehe
            Reporter:
            bjb
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: