所有与JSF相关的web.xml上下文参数名称和值的概述 [英] Overview of all JSF-related web.xml context parameter names and values
问题描述
web.xml
中有几个JavaServer Faces <context-param>
:facelets.REFRESH_PERIOD
,facelets.DEVELOPMENT
,facelets.SKIP_COMMENTS
等.在哪里可以找到所有这些参数的完整列表?
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?
推荐答案
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.
真正的JSF上下文参数名称以javax.faces.
开头.它们在 JSF规范的第11.1.3章中列出.这是来自JSF 2.0规范的相关摘录:
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应用程序配置参数
Servlet容器支持可通过在Web应用程序部署描述符中包括
<context-param>
元素来定制的应用程序配置参数.所有JSF实现都必须支持以下应用程序配置参数名称:
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
-上下文相关的资源路径的逗号分隔列表,JSF实现将在该路径下在加载配置之前查找应用程序配置资源(请参见第11.4.4节应用程序配置资源格式").资源名为"/WEB-INF/faces-config.xml
"(如果存在这样的资源).如果列表中存在"/WEB-INF/faces-config.xml
",则必须将其忽略.
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
-如果设置了此参数,
并在其值的String
表示形式上调用toLowerCase().equals("true")
会返回true
,
Application.createConverter()
必须保证所有时区的默认值
javax.faces.convert.DateTimeConverter
实例必须等于TimeZone.getDefault()
而不是"GMT
".
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
-允许Web应用程序为JSP页面定义备用后缀
包含JSF内容.有关符号常量,请参见javadocs
ViewHandler.DEFAULT_SUFFIX_PARAM_NAME
以获得完整的规范.
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
-如果已设置此参数,则调用
toLowerCase().equals("true")
在其值的String
表示形式上返回true
,默认
ViewHandler
的行为必须符合本规范的最新1.2版本中指定的行为.中指定的任何行为
第7.5节"ViewHandler"并在与处理请求有关的默认ViewHandler
中实现
使用JavaServer Faces视图声明语言编写的页面不能由运行时执行.
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
-如果设置了此参数,则运行时必须将其解释为分号(;)
路径的分隔列表,以"/"开头(不带引号).运行时必须将列表中的每个条目解释为
相对于Web应用程序根目录的路径,并将在该路径处找到的文件解释为facelet标记库,符合
第1.1节应用程序配置资源文件的XML架构定义"中声明的架构,并公开
根据第10.3.2节"Facelet标签库机制"在其中使用标签.运行时还必须考虑
facelets.LIBRARIES
参数名称作为此参数名称的别名,以便与现有参数向后兼容
facelets标签库.
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 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
-ResponseWriter
时在响应上设置的缓冲区大小
生成.默认情况下,该值为-1,它将不会在响应上分配缓冲区大小.这应该增加
如果您使用开发模式是为了确保在发生错误时不会部分呈现响应,
产生.运行时还必须将facelets.BUFFER_SIZE
参数名称视为该参数的别名
名称,以便与现有facelets标记库向后兼容.
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
-以分号(;)分隔的类型的类名称列表
javax.faces.view.facelets.TagDecorator
,带有无参数构造函数.这些装饰器将是
在对Facelets VDL视图的第一个请求命中ViewHandler
进行页面编译时加载.
还必须将facelets.DECORATORS
参数名称视为该参数名称的别名,以便向后
与现有的facelets标签库兼容.
javax.faces.DECORATORS
-- A semicolon (;) delimitted list of class names of type
javax.faces.view.facelets.TagDecorator
, 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
-请求页面时,
编译器检查更改.如果您不希望编译器在页面编译后检查更改,请使用
值为-1.设置较低的刷新周期有助于在开发期间能够在运行中编辑页面
运行时还必须将facelets.REFRESH_PERIOD
参数名称视为此应用程序的别名
参数名称,用于与现有facelets标记库向后兼容.
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
-如果设置了此参数,则运行时必须将其值解释为
扩展javax.faces.view.facelets.ResourceResolver
的Java类的标准类名
并具有零参数公共构造函数或一个单参数公共构造函数,其中参数的类型为
ResourceResolver
.如果设置了此参数,但其值不符合那些要求,则运行时必须
记录消息并继续.如果确实符合这些要求并且具有一个参数的构造函数,则默认
ResourceResolver
必须传递给构造函数.如果它的参数构造函数为零,则将直接调用它.
无论哪种情况,新的ResourceResolver
都会替换旧的ResourceResolver
.运行时还必须考虑
facelets.RESOURCE_RESOLVER
参数名称作为此参数名称的别名,以向后兼容
现有的facelets标签库.
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
-如果已设置此参数,则调用
toLowerCase().equals("true")
在其值的String
表示形式上返回true
,运行时必须
确保Facelets源页面中的任何XML注释都不会传递给客户端.运行时还必须
将facelets.SKIP_COMMENTS
参数名称视为此参数名称的别名,以实现向后兼容
使用现有的facelets标签库.
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
-允许Web应用程序为基于Facelet定义备用后缀
包含JSF内容的XHTML页面.有关符号常量,请参见javadocs
ViewHandler.FACELETS_SUFFIX_PARAM_NAME
以获得完整的规范.
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
-如果设置了此参数,则运行时必须将其解释为分号
(;)的字符串分隔列表,用于强制声明应用程序中的某些页面必须解释为
使用Facelets,无论其扩展名如何.运行时还必须考虑facelets.VIEW_MAPPINGS
参数名称作为此参数名称的别名,以与现有Facelets应用程序向后兼容.见
完整的符号常量ViewHandler.FACELETS_VIEW_MAPPINGS_PARAM_NAME
的javadocs
规范.
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
-运行时必须将此参数的值解释为
逗号分隔的视图ID列表,每个视图ID必须使用状态保存机制保存其状态
在JSF 1.2中指定.
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
-如果已设置此参数,则
在其值的String
表示形式上调用toLowerCase().equals("true")
会返回true
,任何
UIInput.validate()
的实现必须采取以下附加措施.
如果javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL
上下文参数值为
true
(忽略大小写),并且UIInput.getSubmittedValue()
返回零长度的String
调用
UIInput.setSubmittedValue(null)
,并继续使用null作为当前提交的值
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
javax.faces.LIFECYCLE_ID
-处理时要使用的Lifecycle
实例的生命周期标识符
JSF请求此Web应用程序.如果未指定,则由以下项标识的JSF默认实例:
LifecycleFactory.DEFAULT_LIFECYCLE
,必须使用.
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
-运行时参考的ServletContext
初始化参数
确定是否应使用部分状态保存机制.
如果未定义,则运行时必须确定应用程序的版本级别.
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.
- 对于版本为1.2及以下版本的应用程序,运行时不得使用部分状态保存机制.
- 对于版本为2.0及更高版本的应用程序,运行时必须使用部分状态保存机制.
如果定义了此参数,并且应用程序的版本低于1.2,则运行时不得使用局部参数.
状态保存机制.否则,如果已定义此参数,并在String
上调用toLowerCase().equals("true")
其值的表示形式返回true
,则运行时必须使用部分状态机制.否则为部分状态
保存机制一定不能使用.
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
-一个易于阅读的字符串,描述此特定JSF应用程序所在的位置
软件开发生命周期.有效值为"Development
","UnitTest
","SystemTest
"或
"Production
",对应于该类的枚举常量
javax.faces.application.ProjectStage
.也可以通过JNDI设置该值.见javadocs
表示Application.getProjectStage()
.
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()
.
javax.faces.STATE_SAVING_METHOD
-保存状态信息的位置.有效值为
"server
"(通常保存在HttpSession
中)和"client
"(通常保存为后续形式中的隐藏字段)
提交).如果未指定,则必须使用默认值"server
".
javax.faces.STATE_SAVING_METHOD
-- The location where state information is saved. Valid values are
"server
" (typically saved in HttpSession
) 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
-如果已设置此参数,则调用
toLowerCase().equals("true")
在其值的String
表示形式上返回true
,所有提交的字段
将被验证.这是允许模型验证器确定是否为空值或空值所必需的
在当前应用程序中是允许的.如果值为false
,则将不将null或空值传递给验证程序.
如果值是字符串"auto
",则运行时必须检查当前的JSR-303 Beans Validation是否存在
环境.如果是这样,则运行时必须像已指定值"true
"一样继续进行.如果JSR-303 Bean验证
在当前环境中不存在时,运行时将继续进行,就像已指定值"false
"一样.如果
参数未设置,系统必须表现为参数设置为"auto
".
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 "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
-如果已设置此参数,则调用
toLowerCase().equals("true")
在其值的String
表示形式上返回true
,运行时不得
自动添加带有等于符号常量值的validator-id的验证器
javax.faces.validator.VALIDATOR_ID
到默认验证器列表.将此参数设置为true将
具有禁用自动安装Bean验证到每个视图中每个视图中的每个输入组件的效果
该应用程序,尽管仍然可以手动安装.
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.
JSF实现可以选择支持其他配置参数以及其他机制,以实现以下目的: 定制JSF实现;但是,依赖于这些功能的应用程序将无法移植到其他JSF 实施.
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.
正如您在上一段中所读到的那样,JSF实现可能还具有自己的上下文参数集.对于以com.sun.faces.
开头的Mojarra,此博客中列出了这些内容:有哪些Mojarra上下文参数可用?对于以org.apache.myfaces.
开头的MyFaces,该参数也在其自己的网站上列出:
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.
这篇关于所有与JSF相关的web.xml上下文参数名称和值的概述的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!