File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Do Get and Do Post Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Do Get and Do Post" Watch "Do Get and Do Post" New topic

Do Get and Do Post

N Jain

Joined: Mar 26, 2001
Posts: 7
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?


Joined: Feb 26, 2001
Posts: 10
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

Joined: Jun 25, 2001
Posts: 10
Hi this has been discussed at this thread
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

Joined: Mar 26, 2001
Posts: 7
thanks for the nice and detailed explanation...
I agree. Here's the link:
subject: Do Get and Do Post
It's not a secret anymore!