aspose file tools
The moose likes Servlets and the fly likes difference between doGet and doPost methods in servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "difference between doGet and doPost methods in servlets" Watch "difference between doGet and doPost methods in servlets" New topic
Author

difference between doGet and doPost methods in servlets

Bhasker Reddy
Ranch Hand

Joined: Jun 13, 2000
Posts: 176
what is the difference in doGet and doPost Methods in java
servlets.
can anyone clearly explain
appreciate your help


Bhasker Reddy
Uma Viswanathan
Ranch Hand

Joined: Jun 14, 2001
Posts: 126
You had not posted your question in a right forum...
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
Moving this to Servlets...
------------------
Valentin Crettaz
Sun Certified Programmer for Java 2 Platform


SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
Gerry Giese
Ranch Hand

Joined: Aug 02, 2001
Posts: 247
http://java.sun.com/j2ee/j2sdkee/techdocs/api/index.html
Or, more specifically:
http://java.sun.com/j2ee/j2sdkee/techdocs/api/javax/servlet/http/HttpServlet.html
This is basic stuff - I would suggest getting (and reading) a book on Servlets or finding some online tutorials about servlets (java.sun.com just happens to have several). It will save you a lot of grief and answer a lot of your questions.


CJP (Certifiable Java Programmer), AMSE (Anti-Microsoft Software Engineer)<br />Author of <a href="http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi" target="_blank" rel="nofollow">Posts in the Saloon</a>
Mahesh Rana
Ranch Hand

Joined: Sep 05, 2001
Posts: 139
protected void doGet(HttpServletRequest req,
HttpServletResponse resp)
Called by the server (via the service method) to allow a servlet to handle a GET request.

protected void doPost(HttpServletRequest req,
HttpServletResponse resp)
Called by the server (via the service method) to allow a servlet to handle a POST request. The HTTP POST method allows the client to send data of unlimited length to the Web server a single time and is useful when posting information such as credit card numbers.

SCJP2
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695


For examples of what GET and POST look like, check this:
http://www.javaranch.com/ubb/Forum7/HTML/006990.html

short version:
any 'normal' request (like if you click the link above) is a GET
If you are submitting a form, depending on the method attribute of your HTML form, you either GET or POST that data.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: difference between doGet and doPost methods in servlets
 
Similar Threads
Difference bet doGet and doPost
doPost and doGet
difference between doGet and doPost methods in servlets
doGet and doPost
servlet