• Post Reply Bookmark Topic Watch Topic
  • New Topic

doGet, doPost, service()

 
Harry Pattern
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the main difference between doGet() , doPost() and service() methods ?
When will I use each one of them ?
Thanks
 
anu manju
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When u use doGet,
1.then all the infn u posted is visible in address bar and
2.the message u posted is limited.
when to use doGet
1.when <a> link is used to call servlet page and 2.method is get in <form> tag,then u must use doGet.
Otherwise u can use doPost
 
Geeta Ramasami
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
When ur servlet is requested by typing in the url in the address bar, then doGet() of the servlet is invoked.When u post a request to a servlet,then doPost() is called.doGet() and doPost() are with respect to the http request.When u r working directly with genericServlet class then service is used to process the user request.
Geeta
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!