Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

doGet(). , Java Servlet Spec Q?

 
rahul dighe
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I was wondering if someone can explain me what do the following lines mean in plain english.
The GET method should be safe, that is, without any side effects for which
users are held responsible. For example, most form queries have no side
effects. If a client request is intended to change stored data, the request
should use some other HTTP method.
The GET method should also be idempotent, meaning that it can be safely
repeated. Sometimes making a method safe also makes it idempotent. For example, repeating queries is both safe and idempotent, but buying a product
online or modifying data is neither safe nor idempotent.side effects for which users are held responsible
 
Sam Dalton
Author
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This means (if I understand correctly) that an Http GET request should retireve data only, that is make no modifications to persistent data. This makes sense if you look at the name, GET (to get data from). In order to persistent data, an HTTP POST request should be sent (to post data to).
If this is adopted, then idempotency would be achieved, that is the method would perfrom the same function (return the same data) no matter how many times it is called.
Hope this explains things at least a little more clearly.
Cheers
Sam
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic