JavaServer Faces
JavaServer Faces (JSF) is a user interface framework, or application programming interface (API), that eases the development of Java™ web applications.
- Easily construct a user interface from a set of reusable user interface components.
- Simplify migration of application data to and from the user interface.
- Help manage user interface state across server requests.
- Provide a simple model for wiring client-generated events to server-side application code.
- Support custom user interface components for build and reuse.
The Apache MyFaces implementation is included with WebSphere Application Server and provides the foundation of the code used for the JSF.
The version of the JSF run time that is included with the product resides in the normal runtime library location and is available to all web applications that use JSF APIs. Loading the JSF servlet works as if the run time was packaged with the web application. The bundled version includes enhancements for better integration with the built-in annotation scanning and other runtime components of WebSphere Application Server.
The specification-related classes javax.faces.* for JSF and the IBM® modified version of the Apache MyFaces JSF Implementation is packaged in the run time.
Typically, web applications that use this API/Framework embed the JSF API and implementation Java archive (JAR) files within their web application 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 2.2 is a part of the Java Platform, Enterprise Edition (Java EE) platform, a web application does not 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, unless you configure your application and the server as described in the following section.
The JSF run time for WebSphere Application Server does not support the use of a single class loader for the entire application because the FacesConfig initialization requires a single class loader for each JSF module during initialization. This support is not available when the application contains multiple web modules and one of those modules is a JSF module. Therefore, you must use multiple class loaders when the application contains multiple web modules and at least one JSF module.
If an application uses the provided JSF MyFaces implementation, it does not need to add the org.apache.myfaces.StartupConfigureListener to its web.xml file.
If you use a third-party JSF implementation that is not included with the product, leave the configuration set to MyFaces, add the third-party listener to the web.xml file that is required; then, 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.