Randall Randall wrote:
>Trying to track down db transaction problems, it occurred to
>me that I use the forward() method in Application quite a lot,
>following the practice demonstrated in Examples/SecurePage.py .
>I've been assuming that awake() is called again for the new
>servlet, and that sleep() is called by forward previous to
>this. Is this not the case? That is, it does appear that
>awake() is called again; I had to add code to handle the case
>of things being initialized twice in my SitePage for a single
>request. I'm less sure, however, that sleep() is called.
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 none.
Note that this behavior is similar for forard() includeURL() and