aspose file tools*
The moose likes Servlets and the fly likes doGet and doPost method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "doGet and doPost method" Watch "doGet and doPost method" New topic
Author

doGet and doPost method

felix thomas
Ranch Hand

Joined: Jun 10, 2001
Posts: 89
What is the advantage of calling doGet method from doPost method or vice versa.
Brahim Bakayoko
Ranch Hand

Joined: Aug 29, 2003
Posts: 155
The amount of data you can pass in.

GET requests are limited in most browsers to 256 characters.

All hrefs are GET and all forms are POST.


SCJP, SCWCD, SCBCD, IBM CSD WebSphere v5, <br />A+, MCP 2000 and 2000 server, CST, and few incompleted certification tracks.<br /> <br />Ivory Coast<br /> <br />Analyze your web Request/Response @ <a href="http://webtools.servehttp.com" target="_blank" rel="nofollow">http://webtools.servehttp.com</a> down for a while...
Scott Duncan
Ranch Hand

Joined: Nov 01, 2002
Posts: 363
Actually GET is default when nothing else is specified. So forms only submit to doPost if the method in the form is specified as such. Also GET is less secure since data is posted in the url....
[ July 01, 2004: Message edited by: William Duncan ]

No more rhymes! I mean it!<br /> <br />Does anybody want a peanut?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61043
    
  66

A frequent pattern that you will see is that the doGet method will call doPost or vice versa. This allows the serlvet to repsond to both GET and POST request in the exact same manner.

If your servlet needs to respond to these differently, then this pattern is not used.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: doGet and doPost method