Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Doubt on HTTP GET method and servlet's doGet() method  RSS feed

 
jose chiramal
Ranch Hand
Posts: 266
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I read this on page 116 of "Head First Servlets and JSP" :

Keep in mind the difference between the HTTP GET method and your servlet's doGet() method.

Could someone please explain me this statement ?
According to me HttpServlet abstract class is having all the http methods like doGet(), doHead(), doPost() etc...
 
Nilesh Miskin
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to HTTP specification, GET method is idempotent i.e. its is there just for getting the specified resource. However HttpServlet's doGet() method which is invoked when you pass a GET request to the Servlet, can be implemented in a way that can cause side-effects. In other words, there is nothing to stop you from implementing the doGet() method in a non-idempotent way even though a GET is supposed to be idempotent.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!