There are several JavaServer Faces <context-param>
in web.xml
: facelets.REFRESH_PERIOD
, facelets.DEVELOPMENT
, facelets.SKIP_COMMENTS
etc. Where I can find a complete list of all those params?
问题:
回答1:
First of all, those starting with facelets.
are not JSF context parameters, but Facelets 1.x context parameters. Previously, during JSF 1.x era, Facelets was not integrated as part of JSF. However, since JSF 2.0, Facelets is integrated as part of JSF, replacing legacy JSP as the default view technology, and most of the Facelets 1.x context parameters were remapped to JSF 2.x context parameters.
The real JSF context parameter names start with javax.faces.
. They are listed in chapter 11.1.3 of the JSF specification. Here's an extract of relevance from the JSF 2.0 specification:
11.1.3 Application Configuration Parameters
Servlet containers support application configuration parameters that may be customized by including
<context-param>
elements in the web application deployment descriptor. All JSF implementations are required to support the following application configuration parameter names:
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 callingtoLowerCase().equals("true")
on aString
representation of its value returnstrue
,Application.createConverter()
must guarantee that the default for the timezone of alljavax.faces.convert.DateTimeConverter
instances must be equal toTimeZone.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 constantViewHandler.DEFAULT_SUFFIX_PARAM_NAME
for the complete specification.
javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER
-- If this param is set, and callingtoLowerCase().equals("true")
on aString
representation of its value returnstrue
, the defaultViewHandler
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 defaultViewHandler
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 “/” (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”and expose the tags therein according to Section 10.3.2 “Facelet Tag Library mechanism”. The runtime must also consider thefacelets.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 theResponseWriter
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 thefacelets.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 typejavax.faces.view.facelets.TagDecorator
, with a no-argument constructor. These decorators will be loaded when the first request for a Facelets VDL view hits theViewHandler
for page compilation.The runtime must also consider thefacelets.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 thefacelets.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 extendsjavax.faces.view.facelets.ResourceResolver
and has a zero argument public constructor or a one argument public constructor where the type of the argument isResourceResolver
. 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 defaultResourceResolver
must be passed to the constructor. If it has a zero argument constructor it is invoked directly. In either case, the newResourceResolver
replaces the old one. The runtime must also consider thefacelets.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 callingtoLowerCase().equals("true")
on aString
representation of its value returnstrue
, the runtime must ensure that any XML comments in the Facelets source page are not delivered to the client. The runtime must also consider thefacelets.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 constantViewHandler.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 thefacelets.VIEW_MAPPINGS
param name as an alias to this param name for backwards compatibility with existing facelets applications. See the javadocs for the symbolic constantViewHandler.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 callingtoLowerCase().equals("true")
on aString
representation of its value returnstrue
, any implementation ofUIInput.validate()
must take the following additional action. If thejavax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL
context parameter value istrue
(ignoring case), andUIInput.getSubmittedValue()
returns a zero-lengthString
callUIInput.setSubmittedValue(null)
and continue processing using null as the current submitted value
javax.faces.LIFECYCLE_ID
-- Lifecycle identifier of theLifecycle
instance to be used when processing JSF requests for this web application. If not specified, the JSF default instance, identified byLifecycleFactory.DEFAULT_LIFECYCLE
, must be used.
javax.faces.PARTIAL_STATE_SAVING
--TheServletContext
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 aString
representation of its value returnstrue
, 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 classjavax.faces.application.ProjectStage
. It is also possible to set this value via JNDI. See the javadocs forApplication.getProjectStage()
.
javax.faces.STATE_SAVING_METHOD
-- The location where state information is saved. Valid values are “server
” (typically saved inHttpSession
) and “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 callingtoLowerCase().equals("true")
on aString
representation of its value returnstrue
, 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 isfalse
, null or empty values will not be passed to the validators. If the value is the string “auto
”, 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 “true
” 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 “auto
”.
javax.faces.validator.DISABLE_DEFAULT_BEAN_VALIDATOR
-- If this param is set, and callingtoLowerCase().equals("true")
on aString
representation of its value returnstrue
, the runtime must not automatically add the validator with validator-id equal to the value of the symbolic constantjavax.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.JSF implementations may choose to support additional configuration parameters, as well as additional mechanisms to customize the JSF implementation; however, applications that rely on these facilities will not be portable to other JSF implementations.
As you can read in the last paragraph, JSF implementations may also have their own set of context parameters. For Mojarra that are the ones starting with com.sun.faces.
which are listed on this blog: What Mojarra context parameters are available? For MyFaces that are the ones starting with org.apache.myfaces.
which are also listed on their own site: MyFaces documentation - Web Context Parameters.