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


Sanjeev Shahi
Ranch Hand

Joined: Feb 26, 2001
Posts: 83
Hi! everyone,
What is difference between GET and POST in Servelets?
Manoranjan Mishra

Joined: Jan 30, 2002
Posts: 8
Using "get" to pass information sends the information appended to the request for the processing page. It tends to be simpler and you can troubleshoot any problems simply by looking at the address bar in your browser since all values passed are displayed there. This is also the primary weakness of this method. The data being passed is visible and is limited in size to the maximum length of a request string.
Using "post" to pass information sends the information embedded in a header during the request for the processing page. It's main advantage is that you can send larger amounts of information. It also doesn't make that information visible in the address bar of the browser which is nice if you are using the "hidden" input type. The value of this type is still readily available to the user by using view source, but the average user won't see it or be confused by any information you may need to pass from your form for processing.

Go through the link below to learn details regarding get and post in servlets

Manoranjan Mishra
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63844

They are two different types of request that the browser can make of the server. Many servlets respond to them in the same manner.
One of the primary differences between a GET and a POST is the manner in which request parameters are passed. In a GET, the parameters are part of the query string, and hence part of the URL (the length of which is limited). A POST passes the parameters as a data stream.
From the point of view of the servlet, this distinction usually doesn't matter; the method request.getParameter() is used regardless of the mechanism.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: GET & POST
It's not a secret anymore!