"Rogatkin, Dmitry M" wrote:
> > While agreeing with Milt's reasoning, I would point out at least one
> > significant feature that you give up when you override the service()
> method --
> > conditional GET support. This allows your servlet (if it appropriately
> > implements the getLastModified() method and does *not* override the
> standard
> > service() method) to send back a NOT_MODIFIED response to the client, and
> thus
> > avoid having to download a page that has not changed since the last time
> it
> > was requested.
> Why calling super.service() doesn't work in this case?
>
Yes, calling super.service() will perform the conditional GET support, but it
will also do everything else it already does, including call your
doGet()/doPost()/etc. method.
If you call super.service() at the beginning of your override method, by the
time it returns, the request has been processed, and the response has been
created. If you wait and call super.service() after you have already prepared
the response, the doGet()/doPost() method that is called will run into
problems trying to acquire a ServletOutputStream or PrintWriter, because you
already grabbed them.
What's left for your overriding service() method to do, unless all you want is
to count hits or something innocuous like that?
>
> Dmitry.
>
Craig McClanahan
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html