• Post Reply Bookmark Topic Watch Topic
  • New Topic

service methods

 
Shivaprakash Shettihalli
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there anything we can do with doGet which we cannot do with DOPost?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. Of course, a GET request can be trigerred by more ways than a POST. You can also call one from the other.
 
Shivaprakash Shettihalli
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ben Souther:
No.

What are you trying to do?


My question is if we can do everything by using Post, why do we have Get then
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The service methods in the servlet spec were created to match the different types of requests found in the HTTP Specification..

Often a servlet developer will want a servlet to behave differently if accessed with a simple get request from a hyperlink click than it would with a POST request generated from a form submission.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That being said, many frameworks and front controllers, these days, will merge doPost and doGet into a single method: doProcess, execute, process, etc....
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!