Name | JSF Plugin |
---|---|
Author | |
Homepage | N/A |
Version | N/A |
Compatibility | Bundled with Struts |
State | Stable |
License | Open Source (ASL2) |
Download | N/A |
Overview
Excerpt |
---|
The JSF Plugin |
Excerpt |
provides support for JavaServer Faces components in your Struts pages with no additional configuration. |
...
On the other hand, the rest of the JSF functionality, including PhaseListeners, components, multiple backing beans, etc. are preserved. The Showcase example has a section demonstrating the JSF integration approach.
Features
- Allows JSF components on normal Struts pages
- Requires no additional configuration
- Allows the JSF lifecycle to be completely customized
- Preserves most JSF framework features so even complex components should work out of the box
Usage
The JSF plugin splits the JSF lifecycle into an optional Interceptor stack and Result, yet retains the page's Action and navigation. Therefore, to use a page with JSF components, you need to:
...
This approach brings an additional advantage to JSF - every page can have an Action to execute page setup code, and the same Action instance will be automatically available later in the JSF page's expression language as action
. This means any common page logic such as retrieving data from a database can remain in your Action, and having that instance available later in your JSF components means the JSF configuration file is completely optional. The JSF configuration file, faces-config.xml
, generally contains backing bean definitions and navigation rules, both of which can be solely handled by Struts.
Example
The following is an example of a regular Struts Action 2 page definition:
...
Notice the Action-based navigation remains, but now you can use a page with JSF components and have complete access to the JSF lifecycle. This even supports JSF components that post back to themselves or add PhaseListeners to provide advanced AJAX support.
Settings
This plugin does not have any customizable settings.
Installation
This plugin can be installed by copying the plugin jar into your application's /WEB-INF/lib
directory. No other files need to be copied or created.
Version History
Version | Date | Author | Notes |
---|
N/A