Initialize an actionform object with formtag
This section mentioned earlier, the action URL in the HTML form is mapped to a
Save form data with ActionForm
Actionform derived objects are used to save the parameters of the request object, so they are closely linked to the user. A subclass of an ActionForm is a method for accessing the HTTPSERVLETREQUEST object parameter attribute JavaBean. If the ActionForm object is established by FormTag, the RequestProcessor will access the form from the developed activity range in the later FormTAG form translation request; the form you want to obtain is identified by the relevant action mapping. RequestProcessor will then rearrange the form attribute, populate the form with the request, and then call the Validate (...) method of the form object to perform the server-side user input verification. The validate (...) method is called only when the Validate property is set to TRUE only in the ActionMapping object; this is the default behavior. Request.getParameterValues (Parameters) is used to get a string [] object, which is used to form a form fill; the result of the verification should be an ActionerRors object, with org.apache.struts.taglib.html.errostag to display the verification error to the user. ActionForm can also be used to save the current user will be referenced by an intermediate model state that references referenced by a view.
An ActionForm class can also be established by RequestProcessor. This occurs in a form that is completed forward to a URL, which is mapped to the controller servlet rather than the form properties specified by JSP and corresponding action mapping. In this case, if you don't find it within the specified activity range, the RequestProcessor will try to find a form bean that could result in a new ActionForm object. The ActionForm object is found in the specified activity range of the name property of the
A DynaActionForm object is an object with a dynamic property collection. DynaActionForm extends ActionForm, which allows you to create a form object by declaring a struts-config.xml, as follows:
Type = "org.apache.struts.action.dynaactionform"> form-bean> RequestProcessor is established in the same way as ActionForm, populates and verifies DynaActionForm, for example, the parameters of the request object are filled into the DynaActionform in the to sum up Implementing the MVC Semantics (Semantics) for an HTTP protocol based on request / response requires significant time and effort. Select a suitable architecture to solve this problem with a leading project, allowing architects and developers to focus on transaction semantics rather than integration. Struts also provides adequate models such as Struts Validator to declare form validation, TILES to gather a view; these models enhance architecture and greatly simplify design and development tasks. Struts more information and related configurations and installations can be found at http://jakarta.apache.org/struts/userguide/index.html. Because Struts development is an ongoing development, some implementations will also be changed when you read this article, so it is the best version of the release of http://jakarta.apache.org/struts And update to make up this chapter. reference [CORE] Core J2EE Patterns by Deepak Alur et. Al. (Prentice Hall, 2001) [GOF] Design Patterns By Erich Gamma et. Al. (Addison-Wesley, 1995) After completing, the first translation is also to deal with the exam ~ Turn it, everyone is forgiven ~ Ice cloud translation, please let us know. IceCloud@sina.com