Tutorials to .com

Tutorials to .com » Jsp » Xml » Spring WebFlow: 3 (WebFlow achieve reuse)

Spring WebFlow: 3 (WebFlow achieve reuse)

Print View , by: iSee ,Total views: 10 ,Word Count: 451 ,Date: Mon, 20 Apr 2009 Time: 8:20 PM


WebFlow reuse of process definition, such as the login process, targeted to be structured in order to reuse. They package their own definition of the life cycle. These definitions can be easily used to support the Spring configuration of the other reusable Web components. Architect should identify and define the common processes, such as login, search for future reuse.

In addition, Action, if the right combination of design and Spring, it can be reused. They can at the same time by different processes using the action state. These important positions, both application-level processes and the class to enhance the maintainability and code readable sexual.

WebFlow integration with struts and struts in part through a combination of standard Spring classes and some of org.springframework.web.struts package configuration. WebFlow associated with the concept of (Action, ActionFlow) only need to register WebFlow integration specification struts action, and as common as the use of WebFlow action.

The following configuration code from the struts-config.xml, the Action describes how to configure Struts flow into the entrance. WebFlow attention to the specifications of the Action category (org.springframework.web.flow.struts.FlowAction) and attributes "flowId", they Action will be to link up with the landing process. example login process in the Spring application context (ApplicationContext) in the bean as a management loginFlow. you still need to be registered as the process of a Spring managed bean.

<! - Flow actions ->
<action path = "/ loginFlow"
type = "org.springframework.web.flow.struts.FlowAction"
name = "actionForm" scope = "request"
className = "org.springframework.web.flow.struts.FlowActionMapping">
<set-property property="flowId" value="loginAction" />
</ action>

In this example also uses Spring in the RequestProcessor (org.springframework.web.struts.BindingRequestProcessor), is automatically binding form of the Spring and bean. This feature again to avoid writing a separate ActionForm object.

<controller processorClass="org.springframework.web.struts.BindingRequestProcessor"/>

At the same time, it also requires a use of tools to automatically bind the value of Web form to an object.

<plug-in className="org.springframework.web.struts.BindingPlugin"/>

Pre-release of WebFlow can now download, which includes a sample application ( "birthdate"), a detailed description of the integration process.




Java and XML Articles


Can't Find What You're Looking For?


Rating: Not yet rated

Comments

No comments posted.