Use an actionforward navigation
The ActionForward object is a configuration object. These configuration objects have unique identifiers to allow them to retrieve them according to meaningful names such as "Success", "failure". The ActionForward object encapsulates the forward URL path and is requested by the processor to identify the target view. The ActionForward object is built from
Type = "packagename.editcustomerProfileAction" Name = "CustomerProfileform" Scope = "Request"> action> Based on the result of executing the executor's EXECUTE (...) method, when a value matching the value specified in the In Struts-Config.xml Type = "packagename.editcustomerProfileAction" Name = "CustomerProfileform" Scope = "request" INPUT = "Profile"> controller> The above controller> Progressive points to a specific path, if there is no "/" in the path. For advanced or redirects, the URL in Struts is established internally by RequestProcessor with the following structure. If redirect = true, the URL establishes such as / contextPath / path because the URL is explained in httpservletresponse.sendredirect (...) with "/" starting relative to the root directory of the servlet container. If redirect = false, URI established, such as / path, because servletContext.getRequestDisptacher (...) uses virtual directory related URLs. Capture form data The JSP specification provides a standard approach to extract and save form data from JavaBean when requested, using First, we will browse these forms to process semantics until you use simple JavaBeans objects. These objects are implemented as an Actionform object. We will then discuss form processing using the DynaActionForm object, which can support the dynamic collection of attributes when requested. 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 Establish an actionform with dynamic properties 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 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.