File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Generic servlet

Kumar Vinay

Joined: Sep 29, 2000
Posts: 23
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
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
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.
I agree. Here's the link:
subject: Generic servlet
jQuery in Action, 3rd edition