• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

doGet(). , Java Servlet Spec Q?

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Author
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic