-- Getparameter is of the string type. OrHttp://a.jsp? Id = 123Or the data submitted by a form.
-- Getattribute can be an object.
-- Getparameter () is used to obtain the parameter value passed by post/get;
-- Getattribute () is used to obtain the data value in the object container;
-- Getparameter: used for client redirection, that is, when a link is clicked or a button is submitted for value transfer, it is used to receive data when a form or URL is redirected for value transfer.
-- Getattribute: used for server redirection, that is, the forward function is used in the sevlet, or the mapping. findforward function is used in struts. Getattribute can only receiveProgramThe value passed by setattribute.
In addition, you can use setattribute and getattribute to send the receiving object, while getparameter can only transmit strings.
Setattribute indicates that the application server places this object in the memory of the corresponding page. When your Page Server redirects to another page, the Application Server copies the memory to the memory corresponding to another page. In this way, getattribute can get the value you set. Of course, this method can be used to transmit objects. The same is true for sessions, but the lifecycle of objects in the memory is different.
Getparameter is only used by the application server to analyze the text of the Request page you sent, and obtain the value you set when you set it to form or URL redirection.