What Craig meant (I believe) by "prohibits you from modifying the response"
is that the response has been committed and no more data can be sent. The
html/other-data you are sending to the client is part of the response. When
the forward returns, you are prohibited by the spec, from adding any more
information to the response output stream.

If you need to do as you desire, you must use some kind of include based
scheme instead of forward.

Regards,
Paul


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 16, 2001 9:38 AM
To: [EMAIL PROTECTED]
Subject: Re: RequestDispatcher.forward() in Tomcat 3.2.1


You are right.  Control does return to the calling servlet.  It just
couldn't
write to the response.  It would be nice if an exception was thrown.

After control returns to the calling servlet, I try forwarding to a second
servlet and that doesn't seem to work.  The first servlet that was forwarded
to did not change the response.

Is multiple forward within a servlet not supported/allowed?

Bill

"Craig R. McClanahan" wrote:

> William Au wrote:
>
> > Is there any way in Tomcat 3.2.1 for the control to return to a servlet
> > after its
> > call to RequestDispatcher.forward() is completed?
>
> Control *does* return -- RequestDispatcher.forward() is a normal Java
> method call.
>
> However, the servlet spec prohibits you from modifying the response at
this
> point.  If Weblogic lets you do this (for instance, by allowing you to add
> additional text to the response created by the forwarded-to servlet), then
> it is not obeying the spec.
>
> >  That is the behavior
> > of
> > WebLogic 5.1.0.  I want my code to work on the same way running under
> > both.   I am aware of the RequestDispatcher.include() method.
> >
> > Bill
> >
>
> Craig McClanahan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to