Configure third-party JavaServer Faces 2.3 implementations
Use the JavaServer Faces (JSF) Container 2.3 feature to allow Contexts and Dependency Injection (CDI) integration to work with a JSF provider that is bundled within an application.
Use this feature only if we want a JSF provider different from the built-in Liberty JSF provider. To use the default JSF provider from Liberty, use the jsf-2.3 feature instead.
Use the Liberty JSF container to package any 2.3.X version of the MyFaces or Mojarra JSF implementation within an application and also use Liberty CDI integrations. To configure a Liberty server to run an application with JSF 2.3, enable the jsfContainer-2.3 feature and package the JSF API and implementation inside of the application.
Important:
- We cannot use the jsfContainer-2.3 feature with other JSF features, such as jsf-2.3.
- To use the JSF container, package the JSF API javax.faces classes and a JSF implementation inside of the application. The program does not support packaging the JSF API and implementation in a shared library.
- The jsfContainer-2.3 feature is supported only for the JSF API and implementation that correspond to the 2.3 version of the JSF specification. The MANIFEST.MF of the JSF API and implementation must define a Specification-Version between version ranges [2.3,2.4).
- For JSF @ManagedBeans with jsfContainer-2.3, the program does not support the injection of objects with @Resource or @EJB beans. Use the CDI @Named beans instead.
- Update the server.xml file to enable the jsfContainer-2.3
feature as it is displayed in the following example:
<featureManager> <feature>jsfContainer-2.3</feature> </featureManager>
- Package the JSF API and implementation for the JSF provider we want to use within the application. For example, a .war (Web Archive) application that uses a JSF
container with Mojarra might display as it does in the following example:
/WEB-INF/lib/tomcat-websocket-api-7.0.82.jar /WEB-INF/lib/javax.faces-2.3.3.jar
Alternatively, an application can package Apache MyFaces in the following locations within the app:
- /WEB-INF/lib/commons-beanutils-1.9.3.jar # dependency of myfaces
/WEB-INF/lib/commons-collections-3.2.2.jar # dependency of myfaces
/WEB-INF/lib/commons-digester-1.8.jar # dependency of myfaces
/WEB-INF/lib/commons-logging-1.1.1.jar # dependency of myfaces
/WEB-INF/lib/tomcat-websocket-api-7.0.78.jar # dependency of myfaces
/WEB-INF/lib/persistence-2.1.jar # dependency of myfaces when using @EJB
/WEB-INF/lib/myfaces-api-2.3.0.jar
/WEB-INF/lib/myfaces-impl-2.3.0.jar