--- Stuart Donaldson <stu@...> wrote:
> Awake and sleep are both called while in the forward() call to a new
> servlet. The forwarding servlet (the one calling forward()) does not
> finish processing until after the forward() call is through, so the
> forwarding servlet will not go to sleep until then.
> ServletA forwarding to Servlet B, the steps on the servlets are along
> the lines of the following with some processing left out.
> ... process response and determine need to forward...
> A.forward( URL to servlet B )
> createServletInTransaction() locates the servlet and
> attaches it to the transaction.
> You can check request.parent() to see if you are in a forwarded or
> included requestt, it returns the parent servlet, or None if there is
> Note that this behavior is similar for forard() includeURL() and
I am under the impression the sequence of calls described above does
not apply to trans.response().sendRedirect(url). After calling
trans.response().redirect(url) in a.awake(); a.respond(), and
a.sleep() will run before b.awake(), b.respond(), and b.sleep(). Any
output from "a" after calling redirect will be thrown away. The main
difference between forward() and sendRedirect() is the browser's url
will be updated with sendRedirect(). Is this correct?
The new method Page.sendRedirectAndEnd(url) described in the
RelNotes-0.8 document is probably more useful and less confusing than
either sendRedirect() or forward() and probably deserves a mention in
the User's Guide.
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.