tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Russ Trotter" <russtrot...@yahoo.com>
Subject Re: servlet-path, path-info and Filters
Date Thu, 07 Feb 2002 17:42:11 GMT
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".

  Where's the error? (me, Tomcat, the spec, or all of the above) :-)

russ


----- Original Message -----
From: "Craig R. McClanahan" <craigmcc@apache.org>
To: "Tomcat Developers List" <tomcat-dev@jakarta.apache.org>
Sent: Thursday, February 07, 2002 9:09 AM
Subject: Re: servlet-path, path-info and Filters


>
>
> On Wed, 6 Feb 2002, Russ Trotter wrote:
>
> > Date: Wed, 6 Feb 2002 23:04:40 -0700
> > From: Russ Trotter <russtrotter@yahoo.com>
> > Reply-To: Tomcat Developers List <tomcat-dev@jakarta.apache.org>
> > To: Tomcat Developers List <tomcat-dev@jakarta.apache.org>
> > Subject: servlet-path, path-info and  Filters
> >
> > Does anyone here know what the official correct handling of
> > ServletRequest.getServletPath() and ServletRequest.getPathInfo() should
be?
> > More specifically, if I specify a filter with an url-pattern of
"/files/*"
> > and I make a request to "/context/files/foo.jpg", what should
> > getServletPath() and getPathInfo() return?
> >
> > I've observed some differing behavior between Tomcat 4.0.1 and Jetty in
this
> > regard and the spec doesn't explicitly clear up the issue between the
two.
> >
>
> The rules are in the Servlet 2.3 Specification, section 11.  In your
> particular example, getServletPath will return "/files" and getPathInfo()
> will return "/foo.jpg".
>
> > Thanks,
> > russ
> >
>
> Craig
>
>
> --
> To unsubscribe, e-mail:
<mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:tomcat-dev-help@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message