On Fri, 17 Sep 1999, ARCHAIMBAULT SYLVAIN SOPRA wrote:

> --- Reçu de       RENEXTER.ARCHAISY ARCHAIMBAULT * 17/09/99 10.01
>
> For my part, I make the same thing as Steven, because I really don't
> see why you will want different behaviour with GET and POST
> method. Can you give us an example of a situation in which you want
> to do that.

1. Even if you don't want different behavior between GET and POST, it
is very easy to do this without overriding service().  Steven offered
two straightforward alternatves for this -- implement one of
doGet()/doPost() and have the other one call that one, or have them
each call a third method which has the implementation.  By overriding
service(), you are throwing away a lot of functionality.

2. I have written some servlets where the behavior is different
between GET and POST.  The reasons mostly had to do with security
issues -- related to the facts that POST doesn't show parameters in
the URL and cannot be bookmarked.  But sometimes I need to use GET
just because it does show parameters and can be bookmarked.


> From: [EMAIL PROTECTED]
> Date: Thu, 16 Sep 1999 11:43:28 -0500
>
> On Thu, 16 Sep 1999, Steven J. Owens wrote:
>
> [ ... ]
> >      Frankly, I override the service() method.  Various people have
> > said "this is bad" but I've never actually heard a coherent, cogent
> > explanation of why it's bad.  99% of the time you don't really care
> > whether they use GET or POST.  The main reason not to use GET is for
> [ ... ]
>
> Or perhaps you just didn't appreciate those explanations.  What the
> default service() does is very nice, farming requests out to
> appropriate doXXX() methods.  So when you want to do different
> things with GET and POST (or whatever) HTTP methods, it's very nice.
> And still it's very easy to handle the case when they do the same
> thing.
>
> Perhaps you've only worked with servlets that do the same thing with
> GET and POST.  But that doesn't mean that 99% of applications work
> that way.  And if you ever have to change, it'll be a lot easier if
> you had just left service() alone in the first place.
>
> In addition, not having heard a compelling argument for not
> overriding service() is *not* a compelling argument *for* overriding
> service().
>

Milt Epstein
Research Programmer
Software/Systems Development Group
Computing and Communications Services Office (CCSO)
University of Illinois at Urbana-Champaign (UIUC)
[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