You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Neeme Praks <ne...@one.ee> on 2001/05/22 15:00:33 UTC

servlet mapping to root of the site and different web-app contexts

I'm trying to achieve the following effect:
I have a servlet (Turbine/Jetspeed) that I want to map to the root of my
website.
And I have a bunch of images that I want to be served as-is from the
filesystem.

To achieve this effect, I have defined a root webapp context and mapped the
servlet to the root of that context (that was pretty straightforward).
For the images, I have defined another web-app context.

However, when loading up page, none of the images show up... So, most
probably, Tomcat is not overriding the servlet mapping with the context
mappings...

Is it my stupidity or is it Tomcat? :-)

Any ideas?

Neeme

PS. Using Tomcat 3.3m2 on Win2K with Sun JDK 1.3 (Classic VM (build 1.3.0-C,
native threads, nojit))

context definitions:
<?xml version="1.0" encoding="ISO-8859-1"?>
<webapps>
    <Context path="/portal/"
             docBase="/opt/portal"
             reloadable="true"
             trusted="false" >
    </Context>
    <Context path="/"
             docBase="/opt/portal"
             reloadable="true"
             trusted="false" >
    </Context>
</webapps>

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>
    <servlet>
        <servlet-name>portal</servlet-name>
        <servlet-class>Turbine</servlet-class>
        <init-param>
            <param-name>properties</param-name>

<param-value>\WEB-INF\conf\TurbineResources.properties</param-value>
        </init-param>
    </servlet>
    <servlet-mapping>
        <url-pattern>/</url-pattern>
        <servlet-name>portal</servlet-name>
    </servlet-mapping>
</web-app>