+

Search Tips   |   Advanced Search

Configure JSF engine parameters

WebSphere Application Server does not support the modification of deployment descriptor extension parameters through the administrative console or through administrative scripting.

To add, change or delete JSF engine configuration parameters, complete the following steps:


Tasks

  1. Open the WEB-INF/web.xml file. (Dist) (ZOS)

    JSP engine configuration parameters are stored in a web module's configuration directory or in a web modules's binaries directory in the WEB-INF/web.xml file. Open the WEB-INF/web.xml file from:

    (Dist) (ZOS)

    • The configuration directory, as in the following example: {WAS_ROOT}/profiles/profilename/config/cells/cellname/applications/enterpriseappname/ deployments/deployedname/webmodulename

    • The binaries directory if an application was deployed into WAS with the flag Use Binary Configuration set to true. An example of a binaries directory is: {WAS_ROOT}/profiles/profilename/installedApps/nodename/EnterpriseAppName/WebModuleName/

    (iSeries)

    JSF engine configuration parameters are stored in a web module's configuration directory or in a web modules's binaries directory in the WEB-INF/web.xml file. Open the WEB-INF/web.xml file from:

    (iSeries)

    • The configuration directory, as in the following example: profile_root/config/cells/cellName/applications/enterpriseAppName/deployments/deployedName/webModuleName/WEB-INF/web.xml

    • The binaries directory if an application was deployed into WAS with the flag Use Binary Configuration set to true. An example of a binaries directory is: profile_root/installedApps/nodeName/applicationName.ear/applicationName.war/WEB-INF/web.xml

  2. Edit the WEB-INF/web.xml file.

    • To add configuration parameters, use the following format:
      <context-param>
      		<description>descriptive text</description>
      		<param-name>parameter name</param-name>
      		<param-value>parameter value</param-value>
      </context-param>
      

    • To delete configuration parameters, either delete the line from the file, or enclose the statement with <!-- --> tags.

  3. Save the file.

  4. Restart the Enterprise Application. It is not necessary to restart the server for parameter changes to take effect. However, some JSP engine configuration parameters affect the Java source code generated for a JSP. If such a parameter is changed, then we must retranslate the JSP files in the web module to regenerate Java source. Use the batch compiler to retranslate all JSP files in a web module. The batch compiler uses the JSP engine configuration parameters that we have set in the web.xml file, unless you specifically override them. The JSP engine configuration topic identifies the parameters that affect the generated Java source.


Example

The following is a sample of the WEB-INF/web.xml file.

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
	id="WebApp_ID" version="2.5">
	<display-name>Servlet 2.5 example</display-name>
	<welcome-file-list>
		<welcome-file>index.html</welcome-file>
		<welcome-file>index.htm</welcome-file>
		<welcome-file>index.jsp</welcome-file>
		<welcome-file>default.html</welcome-file>
		<welcome-file>default.htm</welcome-file>
		<welcome-file>default.jsp</welcome-file>
	</welcome-file-list>
	<context-param>
      	<param-name>javax.faces.CONFIG_FILES</param-name>
      	<param-value>/WEB-INF/faces-config.xml</param-value>
   	</context-param>
    <context-param>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>server</param-value>
    </context-param>
    <context-param>
        <param-name>com.ibm.ws.jsf.LOAD_FACES_CONFIG_AT_STARTUP</param-name>
        <param-value>true</param-value>
    </context-param>
    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.faces</url-pattern>
    </servlet-mapping>
</web-app>


Subtopics


Related:

  • JavaServer Faces
  • Configure for JavaServer Faces 2.2
  • Manage JavaServer Faces implementations