First off, changed group "To:" to tomcat-user...
Now to your response:
That's the thing, I have no servlet-mapping (or any servlets defined at all
for that matter!) in my example. I'm trying to put a filter on static
content. Here's my web.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"web-app_2_3.dtd">
<web-app>
<filter>
<filter-name>testFilter</filter-name>
<filter-class>TestFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>testFilter</filter-name>
<url-pattern>/files/*</url-pattern>
</filter-mapping>
</web-app>
My "testFilter" does nothing but print the getServletPath() and
getPathInfo(), then call doFilter() to pass the request down the chain.
If my request is "/context/files/foo.html", Tomcat 4.0.1 says the servlet
path is "/files/foo.html" and path-info is null. What am I missing here?
thanks,
russ
----- Original Message -----
From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
To: "Tomcat Developers List" <[EMAIL PROTECTED]>
Sent: Thursday, February 07, 2002 11:02 AM
Subject: Re: servlet-path, path-info and Filters
> > Hello again Craig,
> >
> > Well, after going back into my filter setup again, I see that for
Tomcat
> > 4.0.1, i have the same setup that I describe in my example below (e.g. a
> > url-pattern of "/files/*" for the <filter-mapping> element in web.xml)
but
> > the call to getServletPath() inside that filter returns "/files/foo.jpg"
and
> > getPathInfo() returns null for a request of "/context/files/foo.jpg".
> >
>
> It's the <servlet-mapping> pattern that drives getServletPath() and
> getPathInfo(), not the <filter-mapping> pattern. What's your servlet
> mapping look like?
>
> > Where's the error? (me, Tomcat, the spec, or all of the above) :-)
> >
> > russ
> >
>
> Craig (this is straying into a topic for TOMCAT-USER instead of here ...)
>
> >
--
To unsubscribe: <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>