Here is a proposal:

1. having a "default action" construct that defaults to None, but can be set in a SitePage. If an action is in the request, it's run instead of default.

2. There be a method in page that sets a redirect address, but DOES NOT end the transaction. I suggest .setRedirectURI( ). Of course, the default redirect address would be None.

3. The lifecycle of a servlet is preserved: awake/respond/sleep, with actions continuing to be called from respond, at the beginning of respond

4. After any actions are run, respond does one of two things, depending on the "pending redirect" instance attribute that I mentioned:
- if it's non-empty, sends a redirect header to the browser based on the value
- if it's empty, it calls writeHTML (or whatever analog for non-html http servlets)


This means that unless you set a redirect, all pages, with and without actions, will call the *normal* writeHTML chain, rather than the stumpy one that's in preAction and postAction now.

Also, this keeps what is in effect a "pre-respond", although it's called from respond. An argument can be made that this part should happen in awake, but that is likely to cause greater incompatibility, and I'm shying away from it.

Perhaps Aaron's suggestion of having two types of page; one that has the whole pre-respond/action thing, and one that doesn't is a good one. Though, this is so trivial that a simple if/else test in one servlet could easily do it.

Plus, I like the idea of there being a default action method to run if there's nothing explicit. An alternative to the above proposal would be Ian's idea of "writeHTML" being the default action, but I still don't like the idea of "output" being an action.




------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Webware-discuss mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to