Sunday Sep 01

JSF 2 Configuration parameters

PDF Print E-mail
Thursday, 26 May 2011 08:50
AddThis Social Bookmark Button

Java Server Faces 2.0 Configuration Parameters
Java server faces 2 configuration parameters

Servlet containers support application configuration parameters that may be customized by including elements in the web application deployment descriptor. All JSF implementations are required to support the following application configuration parameter names:

Param name Parameter description

javax.faces.CONFIG_FILES

Comma-delimited list of context-relative resource paths under which the JSF implementation will look for application configuration resources (see Section 11.4.4 "Application Configuration Resource Format"), before loading a configuration resource named "/WEB-INF/faces-config.xml" (if such a resource exists). If "/WEB-INF/faces-config.xml" is present in the list, it must be ignored.

javax.faces.DATETIMECONVERTER_DEFAULT
_TIMEZONE_IS_SYSTEM_TIMEZONE

If this param is set, and calling toLowerCase().equals("true") on a String representation of its value returns true, Application.createConverter() must guarantee that the default for the timezone of all javax.faces.convert.DateTimeConverter instances must be equal to TimeZone.getDefault() instead of "GMT".

javax.faces.DEFAULT_SUFFIX

Allow the web application to define an alternate suffix for JSP pages containing JSF content. See the javadocs for the symbolic constant
ViewHandler.DEFAULT_SUFFIX_PARAM_NAME for the complete specification.

javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER

If this param is set, and calling toLowerCase().equals("true") on a String representation of its value returns true, the default ViewHandler must behave as specified in the latest 1.2 version of this specification. Any behavior specified in Section 7.5 

"ViewHandler" and implemented in the default ViewHandler that pertains to handling requests for pages authored in the JavaServer Faces View Declaration Language must not be executed by the runtime.

javax.faces.FACELETS_LIBRARIES

If this param is set, the runtime must interpret it as a semicolon (;) separated list of paths, starting with g/h (without the quotes).
The runtime must interpret each entry in the list as a path relative to the web application root and interpret the file found at that path
as a facelet tag library, conforming to the schema declared in Section 1.1 "XML Schema Definition for Application Configuration
Resource filehand expose the tags therein according to Section 10.3.2 "Facelet Tag Library mechanism".


The runtime must also consider the facelets.LIBRARIES param name as an alias to this param name for backwards compatibility with existing facelets tag libraries.

javax.faces.FACELETS_BUFFER_SIZE

The buffer size to set on the response when the ResponseWriter is generated. By default the value is -1 , which will not assign a
buffer size on the response. This should be increased if you are using development mode in order to guarantee that the response
isn't partially rendered when an error is generated. The runtime must also consider the facelets.BUFFER_SIZE param name as an
alias to this param name for backwards compatibility with existing facelets tag libraries.

javax.faces.DECORATORS

A semicolon (;) delimitted list of class names of type javax.faces.view.facelets.TagDecorato r, with a no-argument constructor.
These decorators will be loaded when the first request for a Facelets VDL view hits the ViewHandler for page compilation.The runtime
must also consider the facelets.DECORATORS param name as an alias to this param name for backwards compatibility with existing
facelets tag libraries.

javax.faces.FACELETS_REFRESH_PERIOD

When a page is requested, what interval in seconds should the compiler check for changes. If you don't want the compiler to check for
changes once the page is compiled, then use a value of -1. Setting a low refresh period helps during development to be able to edit
pages in a running application.The runtime must also consider the facelets.REFRESH_PERIOD param name as an alias to this
param name for backwards compatibility with existing facelets tag libraries.

javax.faces.FACELETS_RESOURCE_RESOLVER

If this param is set, the runtime must interpret its value as a fully qualified classname of a java class that extends javax.faces.view.facelets.ResourceResolver and has a zero argument public constructor or a one argument public constructor where the type of the argument is ResourceResolver.

If this param is set and its value does not conform to those requirements, the runtime must log a message and continue. If it does conform to these requirements and has a one-argument constructor, the default ResourceResolver must be passed to the constructor. If it has a zero argument constructor it is invoked directly.

In either case, the new ResourceResolver replaces the old one. The runtime must also consider the facelets.RESOURCE_RESOLVER param name as an alias to this param name for backwards compatibility with existing facelets tag libraries.

javax.faces.FACELETS_SKIP_COMMENTS

If this param is set, and calling toLowerCase().equals("true") on a String representation of its value returns true, the runtime must
ensure that any XML comments in the Facelets source page are not delivered to the client. The runtime must also consider the facelets.SKIP_COMMENTS param name as an alias to this param name for backwards compatibility with existing facelets tag libraries.

javax.faces.FACELETS_SUFFIX

Allow the web application to define an alternate suffix for Facelet based XHTML pages containing JSF content. See the javadocs for the symbolic constant
ViewHandler.FACELETS_SUFFIX_PARAM_NAME for the complete specification.

javax.faces.FACELETS_VIEW_MAPPINGS

If this param is set, the runtime must interpret it as a semicolon
(;) separated list of strings that is used to forcibly declare that certain pages in the application must be interpreted as
using Facelets, regardless of their extension. The runtime must also consider the facelets.VIEW_MAPPINGS
param name as an alias to this param name for backwards compatibility with existing facelets applications. See the
javadocs for the symbolic constant ViewHandler.FACELETS_VIEW_MAPPINGS_PARAM_NAME for the complete
specification.

javax.faces.FULL_STATE_SAVING_VIEW_IDS

The runtime must interpret the value of this parameter as a
comma separated list of view IDs, each of which must have their state saved using the state saving mechanism
specified in JSF 1.2.

javax.faces.INTERPRET_EMPTY_STRING
_SUBMITTED_VALUES_AS_NULL

If this param is set, and
calling toLowerCase().equals("true") on a String representation of its value returns true, any
implementation of UIInput.validate() must take the following additional action.
If the javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL context parameter value is
true (ignoring case), and UIInput.getSubmittedValue() returns a zero-length String call
UIInput.setSubmittedValue(null) and continue processing using null as the current submitted value
11-4 JavaServer Faces Specification . June 2009

javax.faces.LIFECYCLE_ID

Lifecycle identifier of the Lifecycle instance to be used when processing
JSF requests for this web application. If not specified, the JSF default instance, identified by
LifecycleFactory.DEFAULT_LIFECYCLE, must be used.

javax.faces.PARTIAL_STATE_SAVING

The ServletContext init parameter consulted by the runtime to determine if the partial state saving mechanism should be used.
If undefined, the runtime must determine the version level of the application.

For applications versioned at 1.2 and under, the runtime must not use the partial state saving mechanism.
For applications versioned at 2.0 and above, the runtime must use the partial state saving mechanism.


 If this parameter is defined, and the application is versioned at 1.2 and under, the runtime must not use the partial
state saving mechanism. Otherwise, If this param is defined, and calling toLowerCase().equals("true") on a String
representation of its value returns true, the runtime must use partial state mechanism. Otherwise the partial state
saving mechanism must not be used.

javax.faces.PROJECT_STAGE

A human readable string describing where this particular JSF application is in
the software development lifecycle. Valid values are :

  • " Development "
  • " UnitTest "
  • " SystemTest ", or
  • " Production ",

corresponding to the enum constants of the class javax.faces.application.ProjectStage. It is also possible to set this value via JNDI. See the javadocs for Application.getProjectStage(). More details at JSF Project stage

javax.faces.STATE_SAVING_METHOD

The location where state information is saved. Valid values are :

  • "server" (typically saved in HttpSession)
  • "client" (typically saved as a hidden field in the subsequent form submit).

If not specified, the default value "server" must be used.

javax.faces.VALIDATE_EMPTY_FIELDS

If this param is set, and calling toLowerCase().equals("true") on a String representation of its value returns true, all submitted fields
will be validated. This is necessary to allow the model validator to decide whether null or empty values are allowable in the current application. If the value is false, null or empty values will not be passed to the validators. If the value is the string gautoh, the runtime must check if JSR-303 Beans Validation is present in the current environment. If so, the runtime must proceed as if the value gtrueh had been specified. If JSR-303 Beans Validation is not present in the current environment, the runtime most proceed as if the value "false" had been specified. If
the param is not set, the system must behave as if the param was set with the value gautoh.

javax.faces.validator
.DISABLE_DEFAULT_BEAN_VALIDATOR

If this param is set, and calling toLowerCase().equals("true") on a String representation of its value returns true, the runtime must not
automatically add the validator with validator-id equal to the value of the symbolic constant javax.faces.validator.VALIDATOR_ID to the list of default validators. Setting this parameter to true will have the effect of disabling the automatic installation of Bean Validation to every input component in every view in the application, though manual installation is still possible.

Related articles

If you have any remark or questions feel free to put a comment.If you enjoyed this tutorial and want to promote it don't hesitate to click on

Tags: application , param , runtime

Add comment


Security code
Refresh

Java Tutorial on Facebook