JavaServer Faces

JavaServer Faces (JSF) is a user interface framework or application programming interface (API) that eases the development of Java™ based Web applications. WebSphere® Application Server Version 7.0 supports JavaServer Faces 1.2 at a runtime level, therefore using JSF reduces the size of the Web application since runtime binaries no longer need to be included in your Web application.

The JSF runtime also :

Both the SUN Reference Implementation and Apache MyFaces implementation are shipped with the product.

The Sun JSF Reference Implementation provides the foundation of the code used for the JSF support in WebSphere Application Server. However, some dependencies on Jakarta APIs have been removed and replaced with Application Server specific solutions as a result of potential problems that may occur when open source APIs are included in the Application Server runtime. For example, when included in the Application Server runtime, these open source APIs are made available to all applications installed within the Application Server, therefore bringing versioning, support and legal issues. The version of the JSF runtime provided by the Application Server resides in the normal runtime library location and is available to all Web applications that leverage JSF APIs. The loading of the JSF servlet works in the same manner as if the runtime was packaged with the Web application.

The following open source dependencies are replaced with other APIs or in-house versions: The JSF Specification requires JavaServer Pages Standard Tag Library (JSTL) as a dependency, therefore the required version of the JSTL from Jakarta is made available in the Application Server runtime.
Figure 1. Current external API dependencies from the Sun based JSF runtime important

Figure 2. Replacement APIs
important

The specification related classes (javax.faces.*) for JSF and the IBM® modified version of the JSF Sun reference implementation are packaged in the Application Server runtime.

Typically, Web applications that leverage this API/Framework embed the JSF API and implementation Java archive (JAR) files within their Web archive (WAR) file. This is not required when these Web applications are deployed and run within WebSphere Application Server. Only the removal of these JAR files along with any JSTL JAR files from the WAR file is required. However, because JavaServer Faces 1.2 is a part of the Java Platform, Enterprise Edition (Java EE) platform, a Web application does not need to bundle a JavaServer Faces implementation when it runs on a Web container that is Java EE technology compliant. If a JavaServer Faces implementation is bundled with a Web application, it is ignored as the JavaServer Faces implementation provided by the platform always takes precedence.

The JSF runtime for WebSphere Application Server does not support the use of a single class loader for the entire application. This support is not available when the application contains multiple Web modules and one of those modules is a JSF module. A single class loader for the entire application is not supported because the FacesConfig initialization requires a single class loader for each JSF module to perform the initialization. Therefore, you must use multiple class loaders when the application contains multiple Web modules and at least one JSF module.

For using different implementations of JSF, the WebSphere Application Server JSF engine determines if the SUN RI or Apache MyFaces is used from the application server runtime. After the JSF engine determines the implementation that is used, the correct listener class is registered with the Web container. You not need to add the com.sun.faces.ConfigureListener or the org.apache.myfaces.StartupConfigureListener to your web.xml file.

If you want to use a third party JSF implementation that is not shipped with the product, leave the configuration set to the SUN RI, add the third party listener to the web.xml file that is required and add the third party implementation JAR files to the Web module as an isolated shared library. Using an isolated shared library, the Web application version of the JSF or JSTL classes load before the Application Server.

FacesBeanUtils class

The FacesBeanUtils class provides static method replacements for methods used in the Jakarta Commons BeanUtils API. The FacesBeanUtils class has no life cycle.

FacesBeanUtils class
FacesBeanUtils
+ getProperty ( [in] bean : Object , [in] property : String ) : Object
+ getPropertyType ( [in] bean : Object , [in] property : String ) : Class
+ getSimpleProperty ( [in] bean : Object , [in] property : String , [in] value : Object )
+ getProperty ( [in] bean : Object , [in] property : String , [in] value : Object )
+ convertFromString ( [in] value : String , [in] valueClass : Class ) : Object
+ convert ([in] targetType : Class , [in] bean : String ) : Object



Related tasks
Configuring JavaServer Faces implementation
Managing JavaServer Faces implementations using wsadmin scripting
Task overview: Developing and deploying Web applications
Developing Web applications
Configuring JSF engine parameters
Related reference
JSF engine configuration parameters
Concept topic    

Terms of Use | Feedback

Last updated: Oct 22, 2010 12:21:29 AM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=compass&product=was-nd-zos&topic=cwebjavaserverfaces
File name: cweb_javaserver_faces.html