Configuring for JavaServer Faces 2.2

You can configure WebSphere® Application Server tradicional Versão 9.0 to use JSF 2.2 for improved developer efficiency and compatibility with modern paradigms.

Before you begin

Ensure that your application is configured for JavaServer Faces (JSF) by using the specific web.xml context parameters for the implementation that you chose.
Attention: The JSF implementation is a server-wide configuration setting on Version 8.0 and later nodes. If you have multiple applications that require different JSF implementations, you must separate the applications into different application servers or clusters; then, specify the implementation for each application server or cluster. For Version 7.0 nodes, the JSF implementation is an application configuration setting. For Version 9.0 and later nodes, the Sun Reference 1.2 JSF implementation is not supported. Instead, use the MyFaces JSF implementation. Alternatively, you can use an isolated shared library, as described for third-party JSF implementations.

About this task

Apache MyFaces 2.2 is used from the product run time. You can use Apache MyFaces 2.2, or your own implementation. You can also configure the JSF implementation on the Provide JSP reloading options for web modules panel for application installation and update wizards. Configure the server or cluster to use the JSF implementation that you want. Complete this task by using the administrative console or the wsadmin tool.

Procedure

  1. In the administrative console panel, click Applications > Application Types > WebSphere enterprise applications > application_name > JSP and JSF options
  2. Select MyFaces 2.2 to use the default MyFaces JSF implementation. If you are using the wsadmin tool, see the following example of setting a cluster to use the MyFaces 2.2 JSF implementation:
    wsadmin>set cluster [$AdminConfig list ServerCluster]
    cluster1(cells/myNode01Cell/nodes/myNode01/clusters/cluster1|cluster.xml#ServerCluster_1173916133721)
    wsadmin>$AdminConfig modify $cluster {{jsfProvider MyFaces}}
    wsadmin>$AdminConfig save
    An example of setting a cluster to use the MyFaces 2.2 JSF implementation:
    wsadmin>set cluster [$AdminConfig list ServerCluster]
    cluster1(cells/myNode01Cell/nodes/myNode01/clusters/cluster1|cluster.xml#ServerCluster_1173916133721)
    wsadmin>$AdminConfig modify $cluster {{jsfProvider MyFaces}}
    wsadmin>$AdminConfig save
    Be Aware: If you want to use a third-party JSF implementation that is not included with the product, complete the following steps:
    1. Add the third-party listener to the web.xml file.
    2. Add the third-party JSF implementation Java™ archive (JAR) files and its required dependant JAR files to the application as an isolated shared library and associate it with your application:
      1. Move the JSF JAR files and all third-party libraries referenced by the JSF JAR files and UI component plug-ins (for example, PrimeFaces) to a directory outside of the application.
      2. Create the isolated shared library. See topic Creating shared libraries for information about how to create the shared library.
      3. Ensure that the classloader is set to PARENT_FIRST, the default value. To view the current configuration in the administrative console panel, click Applications > Application Types > WebSphere enterprise applications > application_name > Class loading and update detection.

What to do next

To use the FlowBuilder API to create Flows with FlowBuilder annotations, the relevant CDI producer method must be declared within a managed bean or a session bean class. To ensure that the class is managed correctly by CDI, give the producer method class a scope to define it as a managed bean, or set CDI bean-discovery-mode to all. You can set the CDI bean-discovery-mode to all in the beans.xml file in your web archive:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd" 
	bean-discovery-mode="all">
</beans>

Ícone que indica o tipo de tópico Tópico de Tarefa



Ícone de registro de data e hora Última atualização: July 9, 2016 7:57
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=tweb_jsf22
Nome do arquivo: tweb_jsf22.html