And I agree that they should be thought of in pairs; everything that awakes must also sleep. In fact, everything must also respond, but it can do so by sending a redirect or running an action.
This has bugged me about WebKit for a while, and we always change our SitePage to make it more consistent:
Our servlets ALWAYS do awake - respond - sleep. WriteHTML() is really inside of respond, and is effectively the default "action". Other actions cause WriteHTML to not really run, and you get bone-headed output like:
<html><body></body></html>
Usually, when an action is run, you either want to redirect somewhere OR do some output. Either way, there is still a response. But the output chain that is so nice in WK is short-circuited with actions.
I have that problem as well, and tend not to use actions as a result -- I find it easier just to do a test in awake().
Since I usually redirect after an "action" (which is also typically a POST), it doesn't come up too much. Though when it does I just slog through without any framework goodness.
In CVS I moved the awake/respond/sleep cycle into the servlet itself, so that you can more easily override the behavior, and particularly so you can do your own exception handling (like a try:finally:) without hacking the WebKit code. So runTransaction() becomes the single entry point for a servlet, and it in turn calls awake/respond/sleep (oh, and I guess it does so with a finally to call sleep -- I thought people had consensed that was the right behavior a while ago).
Oh, and then for some messiness, there's the ability to run a specific method of a servlet (blech) and some other hackiness. These drive me nuts, because there semantics and how they fit into the workflow seems unclear to me. I never use any of them -- anything that fancy should go into non-servlet libraries, IMHO.
Ian
------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click _______________________________________________ Webware-discuss mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webware-discuss
