When you want to pass a common data type to the next page, you can use the getparameter () method on the next page to obtain the data passed on the previous page! (Common data types refer to basic types commonly used in Java, such as int, float, double, and string. However, you can use getparameter () on the next page () the value obtained by the method can only be of the string type. You can convert the string type to the required type !)
When you want to pass an object to the next page, you need to use the getattribut () method! For example, if you want to pass a list or map to the next page, you must use the setattribut () and getattribut () Methods to pass data!
From a deeper perspective, the getparameter () method transmits data only from the Web Client to the Web server, representing the HTTP request data. The getparameter () method returns the string type data! The data transmitted by setattribut () and getattribut () methods is only transmitted within the web server and between the Web Components with forwarding relationships. The two methods can set the object-type shared data!
What is the difference between request. getattribute () and request. getparameter?