tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From (Kedar Choudary)
Subject Re: Servlet in the middle... in the middle.. in the middle
Date Tue, 05 Dec 2000 05:40:50 GMT
I have rewritten following reply to MVC thread.
Hope it helps.
guess, there IS a way to forward the .jsp processing to tomcat's
jsp-servlet, even when you have registered your own servlet to process all
.jps requests.

Instead of using
    ServletContext.getRequestDispatcher(url).forward(request, response);


It worked for me.

Note: This method does not work if you want to "re-write" the url in your
handler servlet. JSP files processed by the jserv-servlet is always the URL
of the original request.
Kedar Choudhary.

----- Original Message -----
From: Craig R. McClanahan <>
To: <>
Sent: Friday, December 01, 2000 1:23 AM
Subject: Re: Servlet in the middle... in the middle.. in the middle

> "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
> > 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
> 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
> Tomcat 4.0 supports).  See my expanded explanation on a thread with
subject "MVC
> problem".
> >
> > Thanks so much for your help!
> >
> > ...Casey
> >
> Craig McClanahan

View raw message