In WebSphere® Application Server, you can configure the JavaServer Faces (JSF) engine configuration parameters for optimal performance in a production server environment and for the needs of developers 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 separated by spaces, you must add quotation marks around the value.
SUN RI parameter name | Description | Default value |
---|---|---|
com.sun.faces.numberOfViewsInSession | Specifies the number of views that are stored in the session when Server-Side State Saving is used. If set to true while client-side state saving is being used, reduces the number of bytes sent to the client by compressing the state before it is encoded and written as a hidden field. | 15 |
com.sun.faces.numberOfLogicalViews | Specifies the number of logical views that are stored in the session when Server-Side State Saving is used. | 15 |
com.sun.faces.enableHighAvailability | If set to true while server-side state saving is used, a serialized representation of the view is stored on the server. This provides failover and server clustering support. | false |
com.sun.faces.injectionProvider | Defines an injection provider that is used for JSF annotations. | |
com.sun.faces.serializationProvider | Defines a serialization provider that is used for serializing JSF objects into session. | |
com.sun.faces.responseBufferSize | Define the size of the response buffer for a JSF response. | 1048 |
com.sun.faces.clientStateWriteBufferSize | 8192 | |
com.sun.faces.expressionFactory | Specifies the default EL Expression Factory to use. | org.apache.el.ExpressionFactoryImpl |
com.sun.faces.clientStateTimeout | The timeout value used for client side state saving. When the value set has been reached then the state is lost. | infinite |
com.sun.faces.displayConfiguration | false | |
com.sun.faces.validateXml | When set to true, tag library XML files and faces configuration XML files using schema are validated during application start. | false |
com.sun.faces.verifyObjects | false | |
com.sun.faces.forceLoadConfiguration | false | |
com.sun.faces.disableVersionTracking | false | |
com.sun.faces.enableHtmTagLibValidator | false | |
com.sun.faces.prerefXHTML | false | |
com.sun.faces.compressViewState | true | |
com.sun.faces.compressJavaScript | true | |
com.sun.faces.sendPoweredByHeader | true | |
com.sun.faces.enableJSStyleHiding | false | |
com.sun.faces.writeStateAtFormEnd | true | |
com.sun.faces.enableLazyBeanValidation | true | |
com.sun.faces.enableLoadBundle11Compatibility | false | |
com.sun.faces.enableRestoreView11Compatibilty | false | |
com.sun.face.serializeServerState | false | |
com.ibm.ws.jsf.JSP_UPDATE_CHECK | This parameter monitors Faces JavaServer Pages (JSP) files for modifications and synchronizes a running server with the changes without restarting the server. If this parameter is set to false or removed from the deployment descriptor, any changes made to Faces JSP files might not be seen by the server until it is restarted. Set this parameter to true while developing and debugging the Faces JSP files to improve the performance of the development environment. | |
com.ibm.ws.jsf.JSF_IMPL_CHECK | Set the com.ibm.ws.jsf.JSF_IMPL_CHECK parameter to true to check at application restart if the SUN RI and MyFaces implementations were switched. If the implementation has switched, then the runtime removes any generated JSP files from the temp directory and the JSP file is retranslated the next time it is requested. | |
com.ibm.ws.jsf.associateLabelWithId | The com.ibm.ws.jsf.associateLabelWithId custom
property changes the rendering behavior for both the <h:selectOneRadio>
and <h:selectManyCheckbox> components. The label no longer wraps
the input element. Instead, each input element has a unique ID and
the label is associated with that ID used for that attribute. Define
and set the com.ibm.ws.jsf.associateLabelWithId context parameter
to true in the web.xml file. Use
the following code as an example.
|
|
com.ibm.ws.jsf.disableEnqueuedMessagesWarning | The com.ibm.ws.jsf.disableEnqueuedMessagesWarning
custom property disables the FacesMessage(s) have been enqueued,
but may not have been displayed warning message. When this
property is set to true in the web.xml file,
this warning message is not included in the SystemOut.log file
.![]() Note: This topic references one or more of the application
server log files. As a recommended alternative, you can configure
the server to use the High Performance Extensible Logging (HPEL) log
and trace infrastructure instead of using SystemOut.log , SystemErr.log, trace.log, and activity.log files on distributed and IBM® i systems. You can also use
HPEL in conjunction with your native z/OS® logging facilities. If you are using HPEL, you can access
all of your log and trace information using the LogViewer command-line
tool from your server profile bin directory. See the information
about using HPEL to troubleshoot applications for more information
on using HPEL.
Use the following
code as an example of how to define and set the com.ibm.ws.jsf.disableEnqueuedMessagesWarning
context parameter to true in the web.xml file.
|
|
com.ibm.ws.jsf.disableStylePassthroughForCheckboxList | This custom property prevents passing the style
information into the items in the check box list. This property defaults
to false to maintain the current behavior. Define and set the com.ibm.ws.jsf.disableStylePassthroughForCheckboxList
context parameter to true in the web.xml file
prevent passing style information into items in the check box list.
Use the following code as an example.
|
|
com.ibm.ws.jsf.DISABLE_UIDATA_NESTED_CHECK | The com.ibm.ws.jsf.DISABLE_UIDATA_NESTED_CHECK
custom property determines whether unique IDs are generated for UIData
components that are nested inside iterator components that are not
UIData components. When this property is set to true in
the web.xml file, unique IDs are generated for UIData components even
if they are nested inside iterator components that are not UIData
components. When this property is set to false, if a JSF dataTable component is nested within a component that does not extend UIData, such as the Java Widget Library (JWL) dataIterator component, the IDs that are generated for the rows do not increment properly. This situation can result in duplicate IDs being assigned to multiple JSF components. Use the following code as an example
of how to define and set the com.ibm.ws.jsf.DISABLE_UIDATA_NESTED_CHECK
context parameter to true in the web.xmlfile.
|
|
com.ibm.ws.jsf.loadExternalDtd | When parsing the faces-config.xml file from
included libraries, the Faces configuration parser attempts to load
the DTD even when validation is disabled. The Faces configuration
parser uses a SAXParser to read the faces-config.xml. The default
behavior of the SAXParser parser is to always load the DTD even if
validation is disabled. This behavior can lead to errors initializing
the Faces Servlet on systems isolated from the internet. In your web.xml file,
set the com.ibm.ws.jsf.loadExternalDtd context paramater to false to
have the Faces configuration parser set the "http://apache.org/xml/features/nonvalidating/load-external-dtd"
feature to false.
|
|
enableRestoreView11Compatibility | A JSF 1.2 application might create the ViewExpiredException
exception under load when using the Sun Reference Implementation.
If your view is not found in session, you can use a compatibility
mode in JSF to create a new view. This can have adverse behaviors
because it is a new view and items that are usually in the view, such
as state, will no longer be available. Use the following code as an
example to set the com.sun.faces.enableRestoreView11Compatibility
context parameter to true in the web.xml file.
This is only applicable when the Sun Reference Implementation is in
use.
|
|
enableViewStateIdRendering | The com.sun.faces.enableViewStateIdRendering
custom property controls the rendering of the id attribute of the
javax.faces.ViewState hidden field. Use the following code as an example
to set the com.sun.faces.enableViewStateIdRendering context parameter
to true in the web.xml file.
|
JSF parameter name | Description | Default value |
---|---|---|
org.apache.myfaces.RESOURCE_VIRTUAL_PATH | /faces/myFacesExtensionResource | |
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 top 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 which 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 |
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 |
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: In
order 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 |
The following options are valid for both the SUN RI and the MyFaces implementations.
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 alternate life cycle 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 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 the JSF implementation uses to enable using alternate 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 being 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 |