Don Brown on Unification of Struts Action and JSF

In Unification: Struts Action and JSF, Don Brown show us how to use Struts Action 2 and JSF as one framework.

Struts Action 2, based on the WebWork 2.2 code, has builtin support for JSF, using an approach that smoothly combines both frameworks into one configuration file, one framework. Struts Action takes the familiar Action-based approach to page logic and navigation, and sprinkles in optional support for JSF components. The result is a framework that lets the developer easily incorporate component-driven pages as application needs dictate.

The JSF components still have access to the entire JSF lifecycle while retaining the action-based paradigm.

JSF/Struts Action configuration file example:

<action name="employee" class="org.apache.struts.action2.showcase.jsf.EmployeeAction">
    <interceptor-ref name="basicStack" />
    <interceptor-ref name="jsfStack" />
    <result name="success" type="jsf" />
    <result name="index" type="redirect-action">index</result>
</action>

Published by

Samuel Santos

Java developer, Open Source hacker, Web technologist, JUG Leader.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>