This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes JSP and the fly likes when do we need a parameter of request ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "when do we need a parameter of request ?" Watch "when do we need a parameter of request ?" New topic
Author

when do we need a parameter of request ?

Nakata kokuyo
Ranch Hand

Joined: Apr 13, 2005
Posts: 442
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

Joined: Aug 11, 2004
Posts: 48
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

Joined: Apr 13, 2005
Posts: 442
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

Joined: Dec 11, 2004
Posts: 13410

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.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Nakata kokuyo
Ranch Hand

Joined: Apr 13, 2005
Posts: 442
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

Joined: Dec 11, 2004
Posts: 13410

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: when do we need a parameter of request ?