Strust -- ActionForm

Source: Internet
Author: User

    ActionForm is essentially a javabean, which is used to process form data. According to some characteristics of form data, ActinForm also has some special functions, such as validate () used to process form data verification and reset () for data reset. Almost all dynamic web pages use forms to accept user input. For example, a typical user logon page contains a user name input box, password input box, and button used to submit the form. ActionForm is used to pass form data between the view layer and the control layer. When a user submits a form, struts automatically fills two values in the user name and password input box into the corresponding field of the corresponding ActionForm. Since ActionForm is used to transmit data between the control layer and the view layer, the control layer can read data from ActionForm, you can also store the data at the model layer in ActionForm and return it to the data layer. (Do not be too complicated when understanding ActinForm. ActionFORM is only a javabean with special functions ).

One issue worth noting is the scope of the ActionForm. The ActionForm has two scopes: request and session. When the ActionForm exists within the scope of the request, the ActionForm will be automatically cleared in one request. If the ActionForm exists in the session range, the ActionForm will be valid throughout the HTTP session process, but struts does not have the built-in function to clear the ActionForm in the session scope, so you need to clear it yourself. Therefore, when multiple pages share the same ActionForm instance, it is set as the session scope. Otherwise, it should be set as the request range first.

There is still a lot of knowledge about ActionForm. I will not list them here, including the relationship between ActionForm, ActionForm and model layer, and the type of ActionForm attributes, if you are interested, you can search for relevant information online.



</

Related Keywords:

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.