File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes doGet method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "doGet method" Watch "doGet method" New topic
Author

doGet method

nizamuddin
Greenhorn

Joined: Oct 24, 2005
Posts: 4
how to make doGet method not to appended message to URL as in the case of doPost
Paul Bourdeaux
Ranch Hand

Joined: May 24, 2004
Posts: 783
The doGet() method in a servlet corresponds to the GET method in the HTTP protocol (IETF standard, RFC 2616). Its primary role in life is to request some thing from a server. It is notreally designed to send data to the server, although it is possible to send a small amount. If you do send data to the server via the GET method, it will be appended to the URL. There is no work around to this.

For futute reference, take a look at the HTTP method definations.


“Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.” - Rich Cook
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

The doGet method is not appending the querystring variables.
The browser is.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
If you don't want the data to show up in the URL, just use POST. of course, that means you will have to create a form if you are not already using one.


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: doGet method
 
Similar Threads
POST or GET
is servlet doGet and doPost method are threadsafe?
Status 405 - HTTP method GET is not supported by this URL
Error 406: error with get
Problem with my servlet Advice?