File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Java SE 8 for the Really Impatient
this week in the
Why only doGet() or doPost() & not service
Joined: Sep 30, 2006
Oct 07, 2006 01:26:00
Why is it advised to override doGet()&/doPost() instead directly overriding service()?
Is it only because the possibility of having implementations for for other doXyz() methods is not possible?
Joined: Feb 24, 2006
Oct 07, 2006 02:04:00
You can override other doXXX methods as well. Most of the time you can accomplish what you want the
to do using the doGet and doPost methods.
SCJP 6 articles
SCJP 5/6 mock exams
More SCJP Mocks
Joined: Aug 02, 2006
Oct 07, 2006 03:16:00
By Overriding service() method, you need to implement logic to read the type of HTTP request (GET/POST). But, currently the service method already does this and dispatches the request to doPost()/doGet() method appropriately.
I agree. Here's the link:
subject: Why only doGet() or doPost() & not service
Why Not Overload Service Method.
Multi-threading in servlets
Differences Between doGet(),doPost(),service()
why we should not override service() method in a servlet
When a request is sent to the servlet
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014