You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Marc-andre Thibodeau <th...@LUB.UMontreal.CA> on 2001/06/12 21:14:01 UTC

Re: problem starting tomcat 4.0

Hi!

I have two servlets interacting in an application:  the Struts' Action
Servlet and another servlet of mine that intercepts all requests and
puts information related to them in a database (referer, host, etc.).
So when a request comes in, myServlet receives it, saves these
information in the database and then forwards the request to the
ActionServlet who does the rest of the job.

Now I would like that after forwarding the request to the ActionServlet,
my servlet "waits" for the *response*, determined by the ActionServlet,
to put some information on it in the database.  But I have no idea how I
can do that...  Perhaps using an include instead of a forward?  Anybody
has an idea??


Marc


Re: problem starting tomcat 4.0

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Tue, 12 Jun 2001, Marc-andre Thibodeau wrote:

> 
> Hi!
> 
> I have two servlets interacting in an application:  the Struts' Action
> Servlet and another servlet of mine that intercepts all requests and
> puts information related to them in a database (referer, host, etc.).
> So when a request comes in, myServlet receives it, saves these
> information in the database and then forwards the request to the
> ActionServlet who does the rest of the job.
> 
> Now I would like that after forwarding the request to the ActionServlet,
> my servlet "waits" for the *response*, determined by the ActionServlet,
> to put some information on it in the database.  But I have no idea how I
> can do that...  Perhaps using an include instead of a forward?  Anybody
> has an idea??
> 

What you're describing is exactly the kind of thing that Filters in the
Servlet 2.3 specification are designed to do.

You can sort-of fake this in 2.2 using RequestDispatcher.include(), but
you are going to find the restrictions on includes (such as not being able
to set the HTTP response headers) to be pretty limiting.

> 
> Marc
> 
> 

Craig McClanahan