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 doPost(), doGet() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "doPost(), doGet()" Watch "doPost(), doGet()" New topic
Author

doPost(), doGet()

narender kaasam
Greenhorn

Joined: May 15, 2006
Posts: 28
Any one could explain me When doGet(), doPost() methods we need to write ?
I know these things.
When client send a request through "Get" method, doGet() method will be called , for "post", doPost() will be called.Except this in servlet when we need to write doGet() or doPost()....
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

This has been answered many times in this forum. A search will help.


Groovy
ak pillai
author
Ranch Hand

Joined: Feb 11, 2006
Posts: 288
doGet:

The request parameters are transmitted as a query string appended to the request. Allows browser bookmarks but not appropriate for transmitting private or sensitive information.

GET was originally intended for static resource retrieval.

GET is not appropriate when large amounts of input data are being transferred.



doPost():

The request parameters are passed with the body of the request.
More secured.


POST was intended for input data submits where the results are expected to change.


Conclusion: Prefer using doPost() and in doGet() you can call doPost() method.


-- Excerpt from the book Java/J2EE Job Interview Companion


java j2ee job interview questions with answers | Learn the core concepts and the key areas
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: doPost(), doGet()