Chapter 3. Settings for different environments

RichFaces includes support for all tags (components) included in the JavaServer Faces (JSF) specification. To add RichFaces capabilities to an existing JSF project, place the RichFaces libraries into the lib directory of the project, and add filter mapping. The behavior of the existing project does not change when you add RichFaces.

3.1. Web Application Descriptor Parameters

RichFaces does not require that any parameters be defined in your web.xml, but the RichFaces parameters listed below will help you during the development process and increase the flexibility of your RichFaces applications.

Table 3.1. Initialization Parameters

Name Default Description
org.richfaces.SKIN DEFAULT The name of a skin that is used in an application. Can be a literal string with a skin name or the EL expression (#{...}) associated with a String property (skin name) of a property of a org.richfaces.framework.skin type. In the latter case, that instance is used as the current skin.
org.richfaces.LoadScriptStrategy DEFAULT Defines how the RichFaces script files are loaded to the application. Possible values are ALL, DEFAULT and NONE.
org.richfaces.LoadStyleStrategy DEFAULT Defines how the RichFaces style files are loaded into the application. Possible values are: ALL, DEFAULT, or NONE.
org.ajax4jsf.LOGFILE none The URL of an application or a container log file (if applicable). If this parameter is set, content from the given URL is shown on a Debug page in the iframe window.
org.ajax4jsf.VIEW_HANDLERS none A comma-separated list of ViewHandler instances for inserting in a view handler chain. These handlers are inserted before the RichFaces viewhandlers, in the order they are listed. In a Facelets application, you would declare com.sun.facelets.FaceletViewHandler here instead of in the faces-config.xml file.
org.ajax4jsf.CONTROL_COMPONENTS none A comma-separated list of special control case components, such as the messages bundle loader or an alias bean component. These handlers are provided via a reflection from the static field COMPONENT_TYPE. Encoding methods for these components are always called while rendering AJAX responses, even if a component has not been updated.
org.ajax4jsf.ENCRYPT_RESOURCE_DATA false For generated resources (such as encrypt generation data), this is encoded in the resource URL. For example, the URL of an image generated by the mediaOutput component contains the name of a generation method. Since malicious code can exploit this to create a request for any JSF bean or attribute, this parameter should be set to true in critical applications. (This fix works with Java Runtime Environment 1.4.)
org.ajax4jsf.ENCRYPT_PASSWORD random A password used to encrypt resource data. If this is not set, a random password is used.
org.ajax4jsf.COMPRESS_SCRIPT true When defined, does not allow the frameword to reformat JavaScript files. This means that the debug feature cannot be used.
org.ajax4jsf.RESOURCE_URI_PREFIX a4j Defines the prefix to be added to the URLs of all generated resources. This is designed to handle RichFaces generated resource requests.
org.ajax4jsf.GLOBAL_RESOURCE_URI_PREFIX a4j/g Defines the prefix to be added to the URI of all global resources. This prefix is designed to handle RichFaces generated resource requests.
org.ajax4jsf.SESSION_RESOURCE_URI_PREFIX a4j/s Defines the prefix to be used to track the sessions of generated resources. This prefix is designed to handle RichFaces generated resource requests.
org.ajax4jsf.DEFAULT_EXPIRE 86400 Defines the period (in seconds) for which resources are cached when they are streamed back to the browser.
org.ajax4jsf.SERIALIZE_SERVER_STATE false If set to true, the component state (not the tree) will be serialized before it is stored in the session. This can be useful in applications with view state that is sensitive to model changes. Alternatively, use com.sun.faces.serializeServerState and org.apache.myfaces.SERIALIZE_STATE_IN_SESSION parameters in their respective environments.

Note

org.richfaces.SKIN is used in the same way as org.ajax4jsf.SKIN.

Table 3.2. org.ajax4jsf.Filter Initialization Parameters

Name Default Description
log4j-init-file - A path (relative to the web application's context) to the log4j.xml configuration file. This can be used to set up per-application custom logging.
enable-cache true Enables caching of framework-generated resources (JavaScript, CSS, images, etc.). However, your cached resources will not be used when attempting to debug custom JavaScript or Styles.
forcenotrf true Forces all JSF pages to be parsed by a HTML syntax check filter. If set to false, only AJAX responses will be parsed and converted to well-formed XML. Setting this to false can improve performance, but may also cause unexpected information to be rendered during AJAX updates.