| Author |
when do we need a parameter of request ?
|
Nakata kokuyo
Ranch Hand
Joined: Apr 13, 2005
Posts: 437
|
|
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: 437
|
|
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: 437
|
|
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
|
 |
 |
|
|
subject: when do we need a parameter of request ?
|
|
|