JSF engine configuration parameters
In WebSphere® Application Server, you 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, you must add quotation marks around the value.
JSF options for MyFaces
JSF parameter name | Description | Default value |
---|---|---|
org.apache.myfaces.PRETTY_HTML | If this value is true, rendered HTML code is formatted so that it is human-readable. Additional line separators and white space are written that do not influence the HTML code. | true |
org.apache.myfaces.ALLOW_JAVASCRIPT | This parameter tells 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 you have pages with long lists and you 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 | This parameter checks 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 that are 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 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 WebSphere Application Server 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 permits 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.
You set the org.apache.el.parser.COERCE_TO_ZERO property using the
administrative console.
|
true |
org.apache.myfaces.DEBUG_PHASE_LISTENER | Enables 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 | Specifies the 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 | Use this parameter to specify a comma-delimited list of context-relative resource paths under which the JSF implementation looks for application configuration resources before loading a configuration resource named /WEB-INF/facesconfig.xml, if a resource exists. | n/a |
javax.faces.DEFAULT_SUFFIX | Specifies the 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 | Specifies that the JSP files in a web module must be recompiled when the application is restarted because the implementation of JSF that is 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 |
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 using 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 | This parameter specifies a class that implements the InjectionProvider. | n/a | Injection provider is provided by the WebSphere Application Server run time | n/a |
com.sun.faces.serializationProvider | This parameter specifies 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 |