Chuck,

Answers inline and below.

On Jan 16, 2009, at 8:20 PM, Caldarale, Charles R wrote:
The above mapping is not useful; since it contains no wildcards, it can only be used as an exact match for the directory, and you've disabled directory listings.


Oops. My fault.



In my web.xml it simply doesn't work.

Are you seeing errors in the logs?

No.

What are you trying that "doesn't work"?  What errors are you seeing?

It appears that no servlet is associated with
/docs or /docs/*.

What leads you to that conclusion?

Lack of responses.



Interestingly my IDE can't seem to find the class

Take the IDE out of the picture - run Tomcat by itself and see what happens.

That's what I've been doing. I only mentioned the IDE because I thought it strange that it couldn't find the class.


I turned on listings and now I am getting a response, but unexpected behavior. My guess is I have fouled up the servlet mapping...

The context is "opendap", and there are three servlets:

    <servlet>
        <servlet-name>hyrax</servlet-name>
<servlet-class>opendap.coreServlet.DispatchServlet</servlet- class>
        <load-on-startup>1</load-on-startup>
    </servlet>


    <servlet>
        <servlet-name>docs</servlet-name>
<servlet-class>org.apache.catalina.servlets.DefaultServlet</ 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>
        <load-on-startup>1</load-on-startup>
    </servlet>


    <servlet>
        <servlet-name>test</servlet-name>
<servlet-class>opendap.experiments.SendErrorTest</servlet- class>
        <load-on-startup>1</load-on-startup>
    </servlet>

With these mappings:

    <servlet-mapping>
        <servlet-name>test</servlet-name>
        <url-pattern>/test</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>test</servlet-name>
        <url-pattern>/test/*</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>hyrax</servlet-name>
        <url-pattern>/hyrax</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>hyrax</servlet-name>
        <url-pattern>/hyrax/*</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>hyrax</servlet-name>
        <url-pattern>*</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>docs</servlet-name>
        <url-pattern>/docs</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>docs</servlet-name>
        <url-pattern>/docs/*</url-pattern>
    </servlet-mapping>


When I go to:

    http://localhost:8080/opendap/docs

I get an empty listing.

When I go to:

    http://localhost:8080/opendap/docs/


I get a listing of the directory $CATALINA_HOME/webapps/opendap/ (minus the WEB-INF and META-INF directories as expected).

The links on the page appear to be correct:

    docs/             http://localhost:8080/opendap/docs/
    initialContent/   http://localhost:8080/opendap/initialContent/
    javadocs/         http://localhost:8080/opendap/javadocs/
    olfs_libraries/   http://localhost:8080/opendap/olfs_libraries/
    views/            http://localhost:8080/opendap/views/

When I try clicking on the docs/ link I (not surprisingly) get the same page back.

When I try clicking on the other links I get empty page responses sent with a 404 HTTP status. Again, not surprising since the Default Servlet isn't getting correctly mapped.

If I remove the error-page mapping:

    <error-page>
        <error-code>404</error-code>
        <location>/docs/error404.html</location>
    </error-page>

Then when I try to access initialContent/, javadocs/, etc. I get the default 404 response.


Can you see the configuration issue?


Thanks,

Nathan


Here is the complete web.xml:


<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
        PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
        "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd";
        >
<web-app>

    <display-name>Hyrax</display-name>
    <description>OPeNDAP Hyrax Server</description>

    <context-param>
        <param-name>ContextPath</param-name>
        <param-value>opendap</param-value>
    </context-param>

    <servlet>
        <servlet-name>hyrax</servlet-name>
<servlet-class>opendap.coreServlet.DispatchServlet</servlet- class>
        <init-param>
            <param-name>DebugOn</param-name>
            <param-value> </param-value>
        </init-param>
        <init-param>
            <param-name>OLFSConfigFileName</param-name>
            <param-value>olfs.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet>
        <servlet-name>docs</servlet-name>
<servlet-class>org.apache.catalina.servlets.DefaultServlet</ 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>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet>
        <servlet-name>test</servlet-name>
<servlet-class>opendap.experiments.SendErrorTest</servlet- class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>test</servlet-name>
        <url-pattern>/test</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>test</servlet-name>
        <url-pattern>/test/*</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>hyrax</servlet-name>
        <url-pattern>/hyrax</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>hyrax</servlet-name>
        <url-pattern>/hyrax/*</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>hyrax</servlet-name>
        <url-pattern>*</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>docs</servlet-name>
        <url-pattern>/docs</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>docs</servlet-name>
        <url-pattern>/docs/*</url-pattern>
    </servlet-mapping>


    <!-- Default Error Page Definitions -->
    <error-page>
        <error-code>400</error-code>
        <location>/docs/error400.html</location>
    </error-page>

    <error-page>
        <error-code>403</error-code>
        <location>/docs/error403.html</location>
    </error-page>

    <error-page>
        <error-code>404</error-code>
        <location>/docs/error404.html</location>
    </error-page>

    <error-page>
        <error-code>500</error-code>
        <location>/docs/error500.html</location>
    </error-page>

    <error-page>
        <error-code>501</error-code>
        <location>/docs/error501.html</location>
    </error-page>

    <error-page>
        <error-code>502</error-code>
        <location>/docs/error502.html</location>
    </error-page>

    <error-page>
        <exception-type>java.lang.Throwable</exception-type>
        <location>/docs/error500.html</location>
    </error-page>

    <session-config>
        <session-timeout>20</session-timeout>
    </session-config>

</web-app>











= = =
Nathan Potter                        ndp at opendap.org
OPeNDAP, Inc.                        541.752.1852



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to