I've added a new method Page.endResponse() which does the following:

- If called from within an awake() or sleep() method, it immediately skips
all further awake(), respond(), and sleep() processing and sends the
accumulated response.

- If called from within respond() (and this includes the writeXXX() methods
called by respond()), it skips the rest of the respond() processing, calls
sleep(), and then sends the accumulated response. (This is because awake()
must have already succeeded, so we ought to call sleep() to clean up
whatever awake() did.)

This is mainly useful if you want to call self.forward() or
self.response().sendRedirect() within a deeply nested hierarchy of method
calls and skip the rest of your processing without having to contort your
code.  It is implemented internally by raising an EndResponse exception
which is silently caught at the appropriate place within Application.
Typical usage is: 

        if some_conditions_are_satisfied():
                self.forward('some/other/servlet')
                # or self.response().sendRedirect('somewhere')
                self.endResponse()
        # continue processing...


- Geoff


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to