JSF engine configuration parameters
In WebSphere Application Server, we can configure the JavaServer Faces (JSF) engine configuration parameters for optimal performance in a production server environment and in a development environment.
The JSF engine parameters are case-sensitive. If the value specified for a parameter is composed of two or more words that are separated by spaces, we must add quotation marks around the value.
JSF options for MyFaces
JSF parameter name Description Default value org.apache.myfaces.PRETTY_HTML Render HTML code to formatted human-readable. Extra line separators and white space are written that do not influence the HTML code. true org.apache.myfaces.ALLOW_JAVASCRIPT Tell MyFaces if JavaScript code is allowed in the rendered HTML output. If JavaScript is allowed, command_link anchors have JavaScript code that submits the corresponding form. If JavaScript is not allowed, the state saving information and nested parameters are added as URL parameters. true org.apache.myfaces.DETECT_JAVASCRIPT
false org.apache.myfaces.AUTO_SCROLL If true, a JavaScript function is rendered that can restore the former vertical scroll on every request. This feature is convenient if we have pages with long lists and we do not want the browser page to jump to the beginning of the page if you trigger a link or button action that stays on the same page. false org.apache.myfaces.ADD_RESOURCE_CLASS
org.apache.myfaces.renderkit.html.util.DefaultAddResource org.apache.myfaces.CHECK_EXTENSIONS_FILTER Check for a properly configured Extensions-Filter if it is needed by the web application. true org.apache.myfaces.COMPRESS_STATE_IN_SESSION Set this option to true to compress the serialized state before it is written to the session. If this option is set to false, the state is not compressed. This option is only applicable if the state saving method is set to server and if org.apache.myfaces.SERIALIZE_STATE_IN_SESSION is set to true. true org.apache.myfaces.DISABLE_FLASH_SCOPE Set this context parameter to true to disable the Flash Scope that results in the cookie not being sent. false org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION Defines the number of the latest views stored in session. This option is only applicable if the state saving method is set to server. 20 org.apache.myfaces.READONLY_AS_DISABLED_FOR_SELECTS
true org.apache.myfaces.SERIALIZE_STATE_IN_SESSION Set this option to true to serialize the state to a byte stream before it is written to the session. If this option is set to false, the state is not serialized to a byte stream. This option is only applicable if the state saving method is set to server. true org.apache.myfaces.STRICT_JSF_2_CC_EL_RESOLVER Ensures that, when a getType() is called over the source EL expression, components that are working with chained EL expressions can use the metadata information that composite: attribute added. Setting this property to true disables this function. false org.apache.el.parser.COERCE_TO_ZERO Allows for the expression language (EL) that WAS uses to coerce null and empty string integer values to a 0 value or for NOT allowing a coerce to a 0 value and retaining the null or empty string integer. The default is true and allows a null or empty string integer value to be coerced to a 0 value.
Important: To keep a null value from being coerced to a 0 value in a MyFaces application, the following context parameter in the web.xml of the application: should be set to ensure that all possible instances of an empty or null value are inhibited from being coerced to zero.
<context-param> <param-name>javax.faces. INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL </param-name> <param-value>true</param-value> </context-param>You set the org.apache.el.parser.COERCE_TO_ZERO property using the administrative console.
- Expand Servers, and then select WASs. Click the appropriate server from the list.
- Under Server Infrastructure, expand Java and Process Management > click Process definition.
- Under Additional Properties, click Java virtual machine.
- Under Additional Properties, click Custom properties.
- Click New and add the org.apache.el.parser.COERCE_TO_ZERO property with the value of false if we do NOT want a null value coerced to zero.
- Click Save to save the change and restart the WAS to ensure that the change takes place.
true org.apache.myfaces.DEBUG_PHASE_LISTENER Enable the DebugPhaseListener in the Development Project Stage. true com.ibm.ws.jsf.disablealternatefacesconfigsearch Disables MyFaces searching for META-INF/*.faces-config.xml for only the web application that this context parameter is set on. If the context parameter and the web container custom property are set, the context parameter takes precedence.
false
General JSF options
JSF parameter name Description Default value javax.faces.STATE_SAVING_METHOD Location where state information is saved. Valid values are 'server', which is saved in HttpSession, and 'client', which is saved as a hidden field in the form. server javax.faces.CONFIG_FILES Specify a comma-delimited list of context-relative resource paths under which the JSF implementation looks for application configuration resources before it loads a configuration resource named /WEB-INF/facesconfig.xml, if a resource exists. n/a javax.faces.DEFAULT_SUFFIX Default suffix for extension-mapped resources that contain JSF components. .jsp javax.faces.LIFECYCLE_ID Use this parameter to configure an alternative lifecycle ID. n/a com.ibm.ws.jsf.JSF_IMPL_CHECK That the JSP files in a web module must be recompiled when the application is restarted because the implementation of JSF used has changed. After the application is restarted, the next time a JSP file is accessed for this module the JSP file is recompiled against the selected implementation of JSF specified in the administration console. Subsequent calls to the JSP file do not recompile. The default setting for this option is false. Use this option for development and not in a production environment. n/a javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL That the submitted values are decoded as null values instead of empty strings. This parameter is ignored for components that extend from UISelectOne/UISelectMany.
This parameter has no effect when EL 3.0 or later is used because a custom ELResolver is required.
false
Sun RI context parameters that have an equivalent behavior in MyFaces
SUN RI parameter name Description RI default MyFaces equivalent MyFaces default com.sun.faces.numberOfViewsInSession Defines the maximum number of serialized views stored in the session. Works with server state saving. 15 org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION 20 com.sun.faces.compressViewState When true the view is compressed after it is serialized and before base64 encoded. Works with client state saving. As of 1.2_09, this option also affects server-side state saving when com.sun.faces.serializeServerState is set to true (this has a large impact of the size of the state in the session when we use this option, at the expense of more CPU.) true org.apache.myfaces.COMPRESS_STATE_IN_CLIENT for client-side state saving or org.apache.myfaces.COMPRESS_STATE_IN_SESSION for server-side state saving false for client-side state saving, true for server-side state saving com.sun.faces.validateXml When true JSF validates the configuration files. false org.apache.myfaces.VALIDATE false com.sun.faces.injectionProvider Specify a class that implements the InjectionProvider. n/a Injection provider is provided by the WAS run time n/a com.sun.faces.serializationProvider Specify a class that implements the SerializationProvider SPI. This implementation represents a hook that the JSF implementation uses to enable the alternative Serialization implementations. n/a org.apache.myfaces.SERIAL_FACTORY - class must implement org.apache.myfaces.shared_impl.util.serial.SerialFactory SPI instead of com.sun.faces.spi.SerializationProvider n/a com.sun.faces.enabledJSStyleHiding If true, inline JavaScript rendered by the HTML ResponseWriter implementation is rendered so that the script is hidden from older browser implementations. false org.apache.myfaces.WRAP_SCRIPT_CONTENT_WITH_XML_COMMENT_TAG true com.sun.faces.serializeServerState If enabled, the component state (not the tree) is serialized before it is stored in the session. This might be desirable for applications that have issues with view state being sensitive to model changes. false org.apache.myfaces.SERIALIZE_STATE_IN_SESSION true
Related:
JavaServer Faces Configure JSF engine parameters Configure for JavaServer Faces 2.2 Manage JavaServer Faces implementations Use High Performance Extensible Logging to troubleshoot applications JSF engine configuration parameters Apache MyFaces web context parameters