| Author |
Why only doGet() or doPost() & not service
|
Syed Khateeb
Greenhorn
Joined: Sep 30, 2006
Posts: 7
|
|
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?
|
 |
Deepak Bala
Bartender
Joined: Feb 24, 2006
Posts: 6592
|
|
|
You can override other doXXX methods as well. Most of the time you can accomplish what you want the servlet to do using the doGet and doPost methods.
|
SCJP 6 articles - SCJP 5/6 mock exams - SCJP Mocks - SCJP 5 Mock exam (Word document ) - SCJP 5 Mock exam in Java.Inquisition format
|
 |
Chetan Raju
Ranch Hand
Joined: Aug 02, 2006
Posts: 109
|
|
|
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.
|
 |
 |
|
|
subject: Why only doGet() or doPost() & not service
|
|
|