JavaServer Faces custom properties

You can configure name-value pairs of data, where the name is a property key and the value is a string value that you can use to set internal system configuration properties. Defining a new property enables you to configure a setting beyond what is available in the administrative console.

You can define the following JavaServer Faces custom properties:

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.

Example

<context-param>
<description>
Set to true to explicitly associate labels with their input elements for select one radio buttons 
and select many check box lists.
</description>
<param-name>com.ibm.ws.jsf.associateLabelWithId</param-name>
<param-value>true</param-value>
</context-param>

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.xml file.

Example

<context-param>
<description>
Set to true to enable unique IDs to be generated for UIData components even
if they are nested inside iterator components that are not UIData components.
</description>
<param-name>com.ibm.ws.jsf.DISABLE_UIDATA_NESTED_CHECK</param-name>
<param-value>true</param-value>
</context-param>

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.

Avoid trouble Avoid trouble: This context parameter only applies to JSF applications that use the Sun Reference Implementation (RI) for JSF implementation.gotcha

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.

Example

<context-param>
<description>
Set to true to disable the following warning message:
FacesMessage(s) have been enqueued, but may not have been displayed
</description>
<param-name>com.ibm.ws.jsf.disableEnqueuedMessagesWarning</param-name>
<param-value>true</param-value>
</context-param>

com.ibm.ws.jsf.disableSessionScopeBeanSync

This custom property, when added as a context parameter to the web.xml file for a specific application, and set to true, disables the update to the session at the end of the JSF request.

Typically, valueUnbound and valueBound methods for session-scoped managed beans, that implement javax.servlet.http.HttpSessionBindingListener, are called multiple times during a JSF request. The JSF implementation attempts to ensure that updates to a managed bean are persisted in a clustered environment whether or not setAttribute is called for the bean.

Avoid trouble Avoid trouble: This property is only applicable if you are using the Oracle JavaServer Faces reference implementation.gotcha

Example

<context-param>
<param-name>com.ibm.ws.jsf.disableSessionScopeBeanSync</param-name>
<param-value>true</param-value>
</context-param>

If you set this context parameter to true and need to persist JSF managed bean updates even when setAttribute is not called, the write all contents feature in the Session Management Tuning can be used. While this feature is available, it could affect performance and should only be enabled when updates are not persisted.

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.

Example

<context-param>
<description>
Set to true if style information should not be passed into items of check box list
</description>
<param-name>com.ibm.ws.jsf.disableStylePassthroughForCheckboxList</param-name>
<param-value>true</param-value>
</context-param>

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.

Example

<context-param>
<description>
When set to false, this property sets a feature on the SAX parser to prevent
loading the external DTD.
</description>
<param-name>com.ibm.ws.jsf.loadExternalDtd</param-name>
<param-value>false</param-value>
</context-param>

enableRestoreView11Compatibility

Because JSF 1.2 is supported, a JSF 1.2 application, might create the ViewExpiredException exception under load. 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, are no longer be there. Use the following code as an example to set the com.sun.faces.enableRestoreView11Compatibility context parameter to true in the web.xml file.

Example

<context-param>
   <param-name>com.sun.faces.enableRestoreView11Compatibility</param-name>
   <param-value>true</param-value>
</context-param>

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.

Example

<context-param>
   <param-name>com.sun.faces.enableViewStateIdRendering</param-name>
   <param-value>true</param-value>
</context-param>



Related tasks
Configuring JavaServer Faces implementation
Related reference
JSF engine configuration parameters
Web container custom properties
Reference topic Reference topic    

Terms and conditions for information centers | Feedback

Last updatedLast updated: Feb 5, 2014 9:49:51 PM CST
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=compass&product=was-nd-mp&topic=rweb_jsf_custom_props
File name: rweb_jsf_custom_props.html