Okay, from the top... :-)

> > I wrote:
> > > > said "this is bad" but I've never actually heard a coherent, cogent
> > > > explanation of why it's bad. [ ... ]

(some messages later)
Milt replies:
> This is one of the first things that I read when I started doing
> servlets.  It's mentioned in Jason Hunter's book, and I suspect most
> servlets books.  It says right there in the API docs "Notice that the
> service method is not typically overridden".  No, they didn't go into
> a lot of detail about why this is recommended practice, [...]

     Which was pretty much what I was complaining about to begin with :-).
Regardless, this thread has been interesting to read, and I now understand
some of the concrete reasons to avoid overriding service, to summarize:

     a) it's a pain if you later want to subclass your servlet and
customize the behavior for doGet vs. doPost,

     b) it interferes with doPut, doDelete, doOptions, doTrace and
getLastModified, if you should ever happen to want those in a subclass.

     On the whole, I think the conversation would have been shorter if
service was named something more descriptive of what it actually does,
like "dispatchRequest", but maybe that's just aesthetics.

Steven J. Owens
[EMAIL PROTECTED]
[EMAIL PROTECTED]

___________________________________________________________________________
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

Reply via email to