wood burning stoves 2.0*
The moose likes Servlets and the fly likes Generic servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Generic servlet" Watch "Generic servlet" New topic
Author

Generic servlet

Kumar Vinay
Greenhorn

Joined: Sep 29, 2000
Posts: 23
Hello,
I want to know whent to extend generic sevlet and HttpSevlet.
Also i have some confusioun when to call service method,dopost,and doget. Could anybody help me
-Vinay
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12825
    
    5
If you are generating web pages and dealing with forms you need to extend HttpServlet. In that case you don't need to change the default service method at all. The servlet container (such as Tomcat) is responsible for calling service - service in turn calls doGet or doPost or whatever according to the user's request.
A normal web page request or a form with method="GET" goes to the doGet method. A form with method="POST" goes to the doPost method.
Bill
 
Consider Paul's rocket mass heater.
 
subject: Generic servlet