The importance of the get and set methods in struts2.

Source: Internet
Author: User

In struts2, The get and set methods are used for data transmission between the client and the server.

 

When you need to use page-based values in the business logic, you only need to ensure the Set Method of the attribute in the action and the name attribute value in the page <s: textfield name = ""/> is the same. (Remove set, and change the method name to a smaller value)

 

When you need to use the return value in the business logic to display the page, you only need to ensure that the value <s: property value = ""/> of the page tag is the same as the get method of the attribute in the action. (Same as above)

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.