Picking this up again after looking at JavaRanch Common's LogServlet class a little closer. First, thanks all, for the answers in the first
thread (
doGet exceptions).
Initially it was like the "wierdo"
doGets and doPosts just worked, sorta like magic (I'll buy that, but not for long) but the connection between the "normal" doGets and doPosts in LogServlet was not at all clear. It's making sense to me now, I'm hoping I can paraphrase it well enough to get feedback on whether I'm on the right track.
As Mike M said, "In the case of a browser post or get being issued to an instance of your
servlet, the application server will call the standard API versions of doPost() and doGet(), which in turn will call the weirdo versions that you've overwritten."
*click, a light goes on*
(A service() gets called before the doPost() or doGet(), right?)
The LogServlet's "normal" doGet basically first checks a condition (that our servlets' requests don't fullfill), then goes to it's else block. Here the only thing that happens is the simplified doGet gets called, passing along the CastMap and Printwriter that it prepared for us. And that's it.
Can I go out and play now?