This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Do Get and Do Post

 
N Jain
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A few questions on GET and POST methods when used in JSPs...
1. Is there any limit on these methods over density of data?
2. If yes,which of these 2 methods can handle more data? and what's that limit?
3. where should one use which method in particular?
answers...?

 
rudhras
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
u can send more data by using post method.This is supposed to be secured when compared to Get method becoz the datas are not transferred as query string in case of post but in get this is done by passing as a query string.
hope this will help
-regards Rudhra
 
subramaniam vaidyanathan
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi this has been discussed at this thread
http://www.javaranch.com/ubb/Forum7/HTML/002665.html
Lets answer your questions all the same
1. limits on density of data: I hope you mean amount of data.. Get can handle much lesser data than Post.. Get can handle as much data as can be appended to the URL (I guess you know that 'Get' data is passed as part of URL).. Now that means it is browser dependent (I'm not sure of this).. All the same 1000 bytes is considered widely as a limit.. As for Post, theoretically it can carry any amoun t of data since now the data is part of the HTTP body... However it makes sense to keep in mind that the lesser data you pass the better.. network etc etc..
2. I guess 1. answers this
3. It is basically more secure to use Post since data is not appended to the URL and is not visible explicitly.. However even Post data is easily retreivable and one should adopt other security mechanisms if the data needs to be secured such as in a transaction based site...
I have quoted below as is from Art Metzers posting in the other mentioned thread..
According to Jason Hunter, author of Java Servlet Programming (an excellent book on the topic of servlets, by the way),
"In practice, the use of GET and POST has strayed from the original intent....Just remember that GET requests, because they can be bookmarked so easily, should not be allowed to cause damage for which the client could be held responsible. In other words, GET requests should not be used to place an order, update a database, or take an explicit client action in any way." (p. 17)
 
N Jain
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the nice and detailed explanation...
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic