Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlet

 
Shrawan Bhageria
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic