Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

doGet and doPost

 
Sree kanth
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all

Why do we require two methods (doGet and doPost)for handling HttpServletRequest (get aswellas post)

Rgds,
sree
 
Eddy Lee Sin Ti
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HTTP/1.1 defines a list of methods, each for different purposes.
Refer HTTP/1.1

Generally, you use GET when you want to retrieve a resource and POST when you must "post" information back to server.
 
Raghu Shree
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
And also if your form is submitted as get, doGet() method is executed in servlet and if your form is submitted as post, doPost() method is excuted.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic