The httpservletrequest class includes both the getattribute () method and the getparameter () method. The two methods have the following differences:
(1) The httpservletrequest class has the setattribute () method instead of the setparameter () method.
(2) When two Web components are linked, the linked component obtains the request parameters through the getparameter () method,
(3) When the forwarding relationship is between two Web components, the forwarding target component shares the data within the request range with the conversion source component through the getattribute () method.
Bytes ----------------------------------------------------------------------------------------------------------
Encountered a problem:
Set
Req. setattribute ("interval num", interval num );
Req. getrequestdispatcher ("/app? Service = external/login "). Forward (req, resp );
Get another page
String shortnum2 = Req. getattribute ("shortnum ");
String parameter num = Req. getparameter ("parameter num ");
The obtained values are the same. Why is the request. getparameter more widely used ??