Network Deployment (Distributed operating systems), v8.0 > Develop and deploying applications > Develop web applications > Assembling web applications > Configure JavaServer Faces implementation
Configure JavaServer Faces implementation
Use this task to specify which JavaServer Faces implementation to use. We can use Apache MyFaces 2.0 or the SUN Reference Implementation 1.2 of JSF, or your own implementation. Ensure that the application is configured for JavaServer Faces (JSF) using the specific web.xml context parameters for the implementation that we have chosen.
Attention: The JSF implementation is a server-wide configuration setting. Thus, if we have multiple applications which require different JSF implementations, separate the applications into different application servers or clusters, and specify the implementation by following the steps in this topic for each application server or cluster. Alternatively, you can use an isolated shared library, as described for third-party JSF implementations, as follows.
For transitioning users: The Application Server JSF engine determines if the SUN Reference Implementation (RI) 1.2 or Apache MyFaces 2.0 is used from the Application Server run time. If either is used, the correct listener class is registered with the web container. You do not need to add the com.sun.faces.ConfigureListener or the org.apache.myfaces.StartupConfigureListener to your web.xml file.trns
Be Aware: To use a third-party JSF implementation that is not shipped with the product, then:
- Keep the configuration set to MyFaces.
- Add the third-party listener to the web.xml file that is required.
- Add the third-party implementation Java archive (JAR) files to the application as an isolated shared library and associate it with the application.
We can also configure the JSF implementation on the Provide JSP reloading options for web modules panel for application installation and update wizards.
Procedure
Configure the server or cluster to use the JSF implementation that you want. We can do this task using the admin console or wsadmin.sh.
- In the admin console panel, click Applications > Application Types > WebSphere enterprise applications > application_name > JSP and JSF options
Select one of the following implementations:
- Sun Reference Implementation 1.2 - Select this option to use the Sun Reference Implementation 1.2 JSF implementation.
- MyFaces 2.0 - Select this option to use the MyFaces 2.0 JSF implementation. This option is the default JSF implementation.
- Use wsadmin.sh:
- An example of setting a single server to use the Sun RI 1.2 JSF implementation:
wsadmin>set server [$AdminConfig list ApplicationServer *server1*] server1(cells/node1Cell/nodes/node1/servers/server1|server.xml#ApplicationServer_1183122130078) wsadmin>$AdminConfig modify $server {{jsfProvider SunRi1.2}} wsadmin>$AdminConfig save- An example of setting a cluster to use the MyFaces 2.0 JSF implementation:
wsadmin>set cluster [$AdminConfig list ServerCluster] cluster1(cells/node1Cell/nodes/node1/clusters/cluster1|cluster.xml#ServerCluster_1173916133721) wsadmin>$AdminConfig modify $cluster {{jsfProvider MyFaces}} wsadmin>$AdminConfig save
Results
Your application server or cluster has now been configured with the JSF implementation you specified. Any application that uses JSF technology uses that implementation, unless it is associated with an isolated shared library that contains a different implementation.
What to do next
Configure JSF engine parameters as necessary.
Related
Configure JSF engine parameters
JavaServer Faces
Manage JavaServer Faces implementations using wsadmin.sh
Create shared libraries
Associate shared libraries with applications or modules
Related
JSF engine configuration parameters