What is the difference between request. getattribute () and request. getparameter?

Source: Internet
Author: User

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?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.