"Bragg, Casey" wrote:

> Is there a way to do the following?
>
> Let's say a user requests /foo/junk.gif, or /foo/test.jsp.
>
> I'd like all requests to /foo/* to first be processed by a servlet.
> The servlet performs some operation (user authentication specifically).
> If the servlet processing performs normally, I want the request forwarded to
> the page actually requested (in the case of .jsp files, the page must be
> processed by the jsp engine first of course).
>
> I've set my Tomcat 3.1 up as defined below.  The result is an infinite loop.
> A request of /foo/junk.gif is redirected to the servlet and then to
> /foo/junk.gif (which then is redirected to the servlet and then to
> /foo/junk.gif... and so on).
>

This question came up earlier today as well.  The bottom line is that you cannot
do what you are after in Tomcat 3.x (which is based on the servlet 2.2
specification).  You can do it by using a Filter from the servlet 2.3 API (which
Tomcat 4.0 supports).  See my expanded explanation on a thread with subject "MVC
problem".

>
> Thanks so much for your help!
>
> ...Casey
>

Craig McClanahan


Reply via email to