Ashwin Sridhar
SCJP | SCWCD | OCA
Ashwin Sridhar wrote:1. Default method
4. It is Idempotent.
and hence secured way of transmitting data from front end to servlets.
3. It is non-Idempotent.
that is even if you try to pass a number of consecutive requests, only one request is passed to server.
Bear Bibeault wrote:
Ashwin Sridhar wrote:1. Default method
There is no such thing as a "default" method. Unless you mean if you omit the method attribute of an HTML form.
definitely there is no method by name default. The request is passed by default as GET HTTP method.
4. It is Idempotent
It should be idempotent,. Whether it is or not entirely depends upon the actions taken by the server-side code..
3. It is non-Idempotent
Again, it depends upon the actions of the server-side code..
that is even if you try to pass a number of consecutive requests, only one request is passed to server.
This is not correct. Nothing will block any number of subsequent requests.
and hence secured way of transmitting data from front end to servlets
Absolutely not. A POST method in no way secures the data. Not at all. Just because data is not visible on the URL does not make it secure!.
Ashwin Sridhar
SCJP | SCWCD | OCA
Ashwin Sridhar wrote:To prevent it, i use POST method which is Non-idempotent.
By secured i mean, data doesn't show up on url and the data being transmitted is not known to user.
Ashwin Sridhar wrote:
Definitely Post method is non-idempotent. No server-side action is required for making POST method non-idempotent.
In a scenario, i need to delete/insert a data in table. Suppose i press the link twice by mistake, in such case the data would be deleted/updated twice in Database.
To prevent it, i use POST method which is Non-idempotent
Oracle Certified Professional: Java SE 6 Programmer && Oracle Certified Expert: (JEE 6 Web Component Developer && JEE 6 EJB Developer)
A lot of people cry when they cut onions. The trick is not to form an emotional bond. This tiny ad told me:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|