Recent articles:
Popular archives:
Java: A platform for platforms
Sun's reorg may seem promising to shareholders but it's also a scramble for position. The question now is whether Sun can,
or wants to, maintain its hold on Java technology. Especially with enterprise leaders like SpringSource and RedHat investing
heavily in Java's future as a platform for platforms
Also see:
Discuss: Java: A platform for platforms?
BEA introduced the Webflow/Pipeline framework for developing Web applications as an alternative to Struts. Like Struts, the Webflow framework is based on the Model-View-Controller pattern and provides benefits similar to any other MVC-based framework. However, because Webflow uses BEA and WebLogic proprietary libraries, applications written using Webflow can run only on the WebLogic application server and provides limited flexibility for incorporating new features. Many IT organizations are realizing these drawbacks and are eager to migrate to open source frameworks such as Struts so they can leverage the flexibility and maintainability that comes with them.
This article — written for developers and architects who are planning or are migrating their Web applications — explains how to move applications developed with Webflow to Struts using Rational Application Developer (referred to as RAD in this article). Readers should have a good understanding of Java programming, and basic familiarity with the Struts framework and of the RAD test environment.
In this article, you will become familiar with the anatomy of a simple Web application written using the WebLogic framework, and you will see, step by step, how to effectively migrate different components to Struts.
As described in "Go with the Flow" by Brian Pontarelli and Grant Zemont (JavaWorld, February 2003), a Webflow is composed entirely of nodes, abstract components that represent an object in a Web application. Nodes are interconnected by transitions or events: Origin JSP (JavaServer Pages) > Input Processor > Destination JSP. Each > symbol is an event processed by the Webflow system. Therefore, a Webflow is a string of connected nodes that outlines a logical flow of a part of a Web application.
A typical Web application written using the BEA Webflow/Pipeline architecture has the following components:
At the heart of a Webflow application is a properties file called webflow.properties, which controls Web page display and initiates execution of the business logic associated with these pages. The Webflow properties file contains one section for each JSP page.
Generically, each transition in the webflow.properties file can be written as: <origin>.[<event>][(<eventName>)]=<target>
The table below describes the valid values for the different webflow.properties elements.
| Element | Valid values |
| <origin> | Begin | <page>.<extension> | <inputprocessorName> | <pipelineName> |
| <event> | Event = link(<linkName>) | button(<buttonName>) | success | exception(<exceptionName>) |
| <target> | <page>.<extension> | <inputprocessorName> | <pipelineName> |
| <extension> | jsp | html | htm | inputprocessor | pipeline |
For example, a typical entry in the webflow.properties file may look like login.jsp.button(createUser)=mypage.jsp. Here, the current state is login.jsp. The event is a button named createUser, and the result state is nextpage.jsp. Note that this does not include the input processor or Pipeline components. In the login JSP page, the form tag uses the
WebFlowJSPHelper API to create the URL for the next page. Specifically, the URL contains the page name and the event that matches the current
state in the webflow.properties file:
Archived Discussions (Read only)