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 servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "servlet" Watch "servlet" New topic
Author

servlet

Shrawan Bhageria
Ranch Hand

Joined: Jun 20, 2005
Posts: 52
pl. anyone tell me about use of this code in servlet.

thanks in advance

public void doGet(HttpServletRequest req, HttpServletResponse res) {
doPost(req.res);
}



SCJP1.4
MCP
SCWCD1.4(preparing)
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

There are multiple 'methods' in HTTP which you can use to call web respources. GET and POST and the most common.

'Typically' (and this is a bit of a generalisation) resources get called using 'GET', although the actual method in some cases is not important. In the case where you don't care, some people allow the same piece of code to execute for both the 'GET' and 'POST' calls.

It is eqivalent to:


Personally I don't do this. Servlets respond to GET, POST, or both, but when it responds to both it behaves differently for each. Others will disagree.

Dave.
moh sak
Ranch Hand

Joined: May 11, 2005
Posts: 78
Originally posted by Shrawan Bhageria:
doPost(req.res);



i think you mean dePost(req,res);

when you submit data and you dont want them to appear in the url you call the doPost method because the doGet method shows every thing in the url.

hope this help you
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: servlet