On Mon, 20 Dec 1999, Kito Mann wrote:
> Jason,
>
> If both GET and POST should work the same way, having doPost() call
> doGet() is fine. However, I was talking about situations where GET
> and POST perform different operations but have some pre-processing
> in common. In these cases, having doPost() call doGet() won't work.
[ ... ]
Well then define a preProcess() method and have both doGet() and
doPost() call it first (I believe someone suggested this, or something
like this). There's still no reason to override service() and throw
away perfectly good functionality. In fact, it's *easier* to do this
than to override service() (e.g. you'd have to repest some code from
the default service() to call the proper doXXX() method). I think
it's cleaner as well, and it stays with the conventional way of using
the HttpServlet methods.
> Please respond to [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> cc: (bcc: Kito Mann/PSG/Prudential)
> Subject: Re: service() instead of doPost() or doGet() (WAS Re: [design]
> set of
>
>
> Kito Mann wrote:
> >
> > if any code is common to
> > all requests, service() seems like a good place to put it...
>
> If you want both GET and POST to behave the same way, just have doPost()
> call doGet(). That makes you HTTP compliant and there's no real extra
> work. It's way easier than the proposed preProcess() call.
>
> public void doPost(...) throws ... {
> doGet(req, res);
> }
>
> -jh-
>
> --
> Jason Hunter
> [EMAIL PROTECTED]
> Book: http://www.servlets.com/book
> 2.0 to 2.1: http://www.javaworld.com/jw-12-1998/jw-12-servletapi.html
> 2.1 to 2.2: http://www.javaworld.com/jw-10-1999/jw-10-servletapi.html
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