Using the Struts-Faces Library


Struts-Faces Library Overview

While Struts and JSF are competing frameworks for developing Web applications in Java, they can also be used together via the Struts-Faces integration library. As JSF technology is more widely adopted, it is likely that many companies will have both Struts- and JSF-based applications in their environment. Companies adopting JSF will probably not rewrite existing Struts applications simply for the sake of using a new technology. However, those companies may decide that all new development will be done using JSF. The Struts-Faces integration library packaged with Struts provides an easy to use "adapter" for using the two technologies together, whether it be to enhance an existing application with JSF's rich UI components or to provide a migration path from Struts to JSF for applications.

The Struts-Faces library is basically an integration layer that allows an application to have a JSF-based user interface that interfaces with a Struts back end. That is, with Struts-Faces, JSF-based user interfaces can be created that utilize Struts back-end code instead of back- end code created using JSF technology. As you know, a typical Struts application uses JSPs and Struts tag libraries to create the user interface. Furthermore, actions and Form Beans are used by the Struts controller servlet to process requests from the user interface. JSF works similarly in that (typically) JSPs are used in conjunction with JSF component tag libraries to create user interfaces that communicate with the JSF controller servlet. The controller servlet uses managed beans along with actions and action listeners to process requests. With Struts-Faces, JSF is used to create the user interface and Struts-Faces ties the JSF-based user interface to a Struts back end consisting of the typical actions and Form Beans managed by the Struts controller servlet.

Struts-Faces ties the two frameworks together by having a custom Struts request processor that integrates with the JSF request processing lifecycle. Additionally, Struts-Faces provides a JSP tag library that integrates the two frameworks. The Struts-Faces tag library has a few tags that take the place of some JSF tags, providing a Struts-based equivalent, and a few other tags that replace some Struts tags with JSF-specific tie-ins.

Supported Versions of Struts

The Struts-Faces library is designed to work with Struts versions 1.2 and later. Previous versions of Struts are not compatible with this library.

Supported Versions of JSF

The Struts-Faces library is designed to work with any implementation of JavaServer Faces version 1.0 or later. Note, however, that the Struts-Faces library has primarily been tested only with version 1.1 of the JavaServer Faces reference implementation from Sun.



Struts. The Complete Reference
Struts: The Complete Reference, 2nd Edition
ISBN: 0072263865
EAN: 2147483647
Year: 2004
Pages: 165
Authors: James Holmes

Similar book on Amazon
Struts 2 in Action
Struts 2 in Action
Murach's Java Servlets and JSP, 2nd Edition
Murach's Java Servlets and JSP, 2nd Edition
Jakarta Struts For Dummies
Jakarta Struts For Dummies
Head First Servlets and JSP: Passing the Sun Certified Web Component Developer Exam
Head First Servlets and JSP: Passing the Sun Certified Web Component Developer Exam

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net