• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Generic servlet

 
Kumar Vinay
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13071
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic