tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: servlet-path, path-info and Filters
Date Thu, 07 Feb 2002 18:01:05 GMT


On Thu, 7 Feb 2002, Russ Trotter wrote:

> Date: Thu, 7 Feb 2002 10:22:56 -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: Re: servlet-path, path-info and  Filters
>
> Thank for your response Craig.
>
> Just re-read SRV.11 (for the umpteenth time!)
>
> So just so I have understanding, whatever resource (either static file,
> servlet, etc) the filter is filtering is irrelavent in determining what is
> returned from getServletPath(), getPathInfo() _in the filter_?
>

Well, mostly ...

I think the most you can say is that what the *first* filter in the chain
sees is what's defined by the servlet spec -- the same thing that the
servlet would see if there were no filters.  However, you're at the mercy
of request wrappers that might have been installed by an earlier filter in
the chain for what you really see.

The servlet spec rules only describe what Tomcat will hand to the first
application component that processes the request.

> >From what you're saying whether it's a filter or a servlet, if the
> url-pattern is "/something/*" then that is the return of the
> getServletPath() call?  Both being consistent with one-another?
>

Yes.  The URL pattern that was matched to select a filter does not affect
the values returned by getServletPath() or getPathInfo() -- which is a
good thing, because different filter mapping patterns could both apply to
the same request and there wouldn't be any way to tell them apart.

> thanks again,
> russ
>

Craig


>
> ----- 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
>
>
> >
> >
> >
> > 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