Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

when do we need a parameter of request ?

 
Nakata kokuyo
Ranch Hand
Posts: 467
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,can someone please explain when we need a parameter of request ?

eg : theCallMethod(httpServlet request){}

thank you very much for guidance
 
Adrian Enns
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nakata, I'm not sure what exactly you're trying to find out here? The HttpServletRequest interface has a getParameter method for grabbing parameters that have been set in the request object via a POST or GET.
 
Nakata kokuyo
Ranch Hand
Posts: 467
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, sorry for making confusing , i do sometimes see people write the function/method which contain the request parameter ,

like as below


why we need to pass a request parameter and when we need it ? thank you
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The request object holds a lot of information pertaining to the request thread.
You would pass that object any time the method you are calling will need access to any of that information.
 
Nakata kokuyo
Ranch Hand
Posts: 467
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you for answer , ben , does it means if we have HttpServletRequest parameter in method , so that the we can get the form's field data ?

what data would normally pertain in request thread ?

please correct me if wrong ..thank you
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Nakata kokuyo:
thank you for answer , ben , does it means if we have HttpServletRequest parameter in method , so that the we can get the form's field data ?

Yes, request.getParameter(String) will get you the form parameters.


what data would normally pertain in request thread ?
please correct me if wrong ..thank you

The best place to look for that information is the API documentation.
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpServletRequest.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic