Request.getattribute (): Is the value of the variable set at request, with Request.setattribute ("name", "Your Own value"), to set the value,
Request.getparameter (): Extract the number of references sent over: this pageRequest.getparameter
is used to accept the number of references from the Get method or the Post method
<form method=post>
<form method=get>
<a href= "1.jsp?id=1" >ok</a>
can only accept java.lang.String
In other words, string hotel_id = Request.getparameter ("hotel_id");
Request.getattribute
is used to accept a variable or action from a servlet (in fact the action is a special servlet)
in Action, Request.setattribute ("ret", ret);
can only accept Java.lang.Object
That is to say list ret = (list) request.getattribute ("ret");
Suppose you just use JSP, you can't use Request.getattribute ()the difference between Request.getattribute () and Request.getparameter () is that Request.getattribute () obtains the object type, while the Request.getparameter () The string type is obtained.
The difference between Request.getparameter and Request.getattribute