JSF Standard Context Params

更详细的:https://wikis.oracle.com/display/GlassFish/JavaServerFacesRI

JSF Standard Context Params

Table 5.1. 

Context ParamJSF SpecDescriptionDefault Value
javax.faces.CONFIG_FILES1.2 and 2.0Comma-delimited list of faces config files.null
javax.faces.DEFAULT_SUFFIX1.2 and 2.0Change the default suffix for JSP views..jsp
javax.faces.LIFECYCLE_ID1.2 and 2.0ID for alternate Lifecycle implementations.null
javax.faces.STATE_SAVING_METHOD1.2 and 2.0"server" or "client"server
javax.faces.DATETIMECONVERTER _DEFAULT_TIMEZONE_IS _SYSTEM_TIMEZONE2.0Controls if DateTimeConverter instances use the system timezone (if true) or GMT (if false).false
javax.faces.DATETIMECONVERTER _DEFAULT_TIMEZONE_IS _SYSTEM_TIMEZONE2.0Controls if DateTimeConverter instances use the system timezone (if true) or GMT (if false).false
javax.faces.DISABLE_FACELET _JSF_VIEWHANDLER2.0Disables the built-in Facelet ViewHandler. Useful for applications that use legacy Facelets implementation.false
javax.faces.FACELETS_LIBRARIES2.0Semicolon-separated list of paths to Facelet tag libraries.null
facelets.LIBRARIES2.0Semicolon-separated list of paths to Facelet tag libraries. Used for backward-compatibility with legacy Facelets implementation.null
javax.faces.FACELETS_BUFFER_SIZE2.0The buffer size set on the response.-1 (no assigned buffer size)
facelets.BUFFER_SIZE2.0The buffer size set on the response. Used for backward-compatibility with legacy Facelets implementation.-1 (no assigned buffer size)
javax.faces.DECORATORS2.0Semicolon-delimited list of TagDecorator implementations. See javadoc for javax.faces.view .facelets.TagDecorator.null
facelets.DECORATORS2.0Semicolon-delimited list of TagDecorator implementations. Used for backward-compatibility with legacy Facelets implementation.null
javax.faces.FACELETS _REFRESH_PERIOD2.0Time in seconds that facelets should be checked for changes since last request. A value of -1 disables refresh checking.implementation-specific
facelets.REFRESH_PERIOD2.0Time in seconds that facelets should be checked for changes since last request. A value of -1 disables refresh checking. Used for backward-compatibility with legacy Facelets implementation.implementation-specific
javax.faces.FACELETS _RESOURCE_RESOLVER2.0An implementation of javax.faces .view.facelets .ResourceResolver. See javadoc for details.null
facelets.RESOURCE_RESOLVER2.0An implementation of javax.faces .view.facelets .ResourceResolver. See javadoc for details. Used for backward-compatibility with legacy Facelets implementation.null
javax.faces.FACELETS_SKIP _COMMENTS2.0If true, strip XML comments out of Facelets before delivering to the client.false
facelets.SKIP_COMMENTS2.0If true, strip XML comments out of Facelets before delivering to the client. Used for backward-compatibility with legacy Facelets implementation.false
javax.faces.FACELETS_SUFFIX2.0Set the suffix for Facelet xhtml files..xhtml
facelets.SUFFIX2.0Set the suffix for Facelet xhtml files. Used for backward-compatibility with legacy Facelets implementation..xhtml
javax.faces.FACELETS_VIEW_MAPPINGS2.0Semicolon-separated list of Facelet files that don't use the default facelets suffix.null
facelets.VIEW_MAPPINGS2.0Semicolon-separated list of Facelet files that don't use the default facelets suffix. Used for backward-compatibility with legacy Facelets implementation.null
javax.faces.FULL_STATE _SAVING_VIEW_IDS2.0Semicolon-separated list of view IDs that must save state using the JSF 1.2-style state saving.null
javax.faces.INTERPRET_EMPTY _STRING_SUBMITTED_VALUES _AS_NULL2.0If true, consider empty UIInput values to be null instead of empty string.false
javax.faces.PARTIAL_STATE_SAVING2.0If true, use the JSF2 partial state saving for views.false, if WEB-INF/faces-config.xml does not declare JSF 2.0 schema. true, otherwise
javax.faces.PROJECT_STAGE2.0Set the project stage to "Development", "UnitTest", "SystemTest", or "Production".Production
javax.faces.VALIDATE_EMPTY_FIELDS2.0If "true", validate null and empty values. If "auto" validate when JSR-303 Bean Validation is enabled (in AS6 it is enabled by default).auto
javax.faces.validator.DISABLE _DEFAULT_BEAN_VALIDATOR2.0If "true", disable JSR-303 Bean Validation.false


5.2. Mojarra Context Params

These context params are only valid when using Mojarra JSF.

Table 5.2. 

Context ParamImpl VerDescriptionDefault Value
com.sun.faces. numberOfViewsInSession1.2 and 2.0For server state-saving, how many views, per logical view, can be stored in the session before oldest is removed?15
com.sun.faces.numberOfLogicalViews1.2 and 2.0For server state-saving, how many logical views are allowed before oldest is removed?15
com.sun.faces.preferXHTML1.2 and 2.0Set xhtml as the content type for browsers that support it.false
com.sun.faces.compressViewState1.2 and 2.0Compress the view after serialization but before encoding.false
com.sun.faces.disableVersionTracking1.2 and 2.0If true, don't allow JSF 1.1 implementations of certain interfaces.false
com.sun.faces.sendPoweredByHeader1.2 and 2.0If true, send a header with the JSF spec level.true
com.sun.faces.verifyObjects1.2 and 2.0If true, verify all JSF artifacts (such as managed beans) can be instantiated during initialization.false
com.sun.faces.validateXml1.2 and 2.0If true, perform XML validation on config files.false
com.sun.faces.displayConfiguration1.2 and 2.0If true, log the values of all Mojarra and JSF context params.false
com.sun.faces.injectionProvider1.2 and 2.0Replace the default InjectionProvider implementation. By default this is set by JBoss AS6.org.jboss.web .jsf.integration .injection .JBossDelegatingInjectionProvider
com.sun.faces.injectionProvider1.2 and 2.0Replace the default SerializationProvider implementation.null
com.sun.faces.responseBufferSize1.2 and 2.0Buffer size for writing most generated content.4096
com.sun.faces. clientStateWriteBufferSize1.2 and 2.0Buffer size for writing client state.8192
com.sun.faces.compressJavaScript1.2 and 2.0Remove whitespace from javascript used in standard JSF components.true
com.sun.faces.externalizeJavaScript1.2 and 2.0Allow browsers to cache javascript used in standard JSF components.false
com.sun.faces.enableJSStyleHiding1.2 and 2.0Hide javascript from older browser implementations.false
com.sun.faces.writeStateAtFormEnd1.2 and 2.0Controls if view state is written after opening a form tag (false) or closing a form tag (true).true
com.sun.faces. enableLazyBeanValidation1.2 and 2.0If false, examine managed beans at startup. Otherwise, validate when referenced/created.true
com.sun.faces. enabledLoadBundle11Compatibility1.2 and 2.0Preserve JSF 1.1 behavior of f:loadBundle. See issue here. false
com.sun.faces.clientStateTimeout1.2 and 2.0Time in seconds that client state is considered valid. If a request is received after timeout expired, ViewExpiredException is thrown.null
com.sun.faces.serializeServerState1.2 and 2.0If true, serialize server-side component state.false
com.sun.faces. enableViewStateIdRendering1.2 and 2.0If false, don't render id attribute on javax.faces.ViewState hidden field. See issue here. true
com.sun.faces. enableScriptsInAttributeValues1.2 and 2.0If false, don't allow attribute values with "javascirpt:" or "script:".true
com.sun.faces.disableUnicodeEscaping1.2 and 2.0"false", "true", or "auto". If "auto", escaping depends on response encoding.See issue here. false
com.sun.faces.developmentMode1.2If true, reload Groovy and faces-config files when edited.false
com.sun.faces. enableMultiThreadedStartup1.2If false, don't create worker threads at startup.true
com.sun.faces.enableThreading2.0If false, don't create worker threads at startup.false
com.sun.faces.resourceBufferSize2.0Read buffer size, in bytes, used by the default ResourceHandler implementation.2048
com.sun.faces.defaultResourceMaxAge2.0Time in milliseconds that a resource from the ResourceHandler will be cached via an "Expires" response header. No caching if ProjectStage is "Development".604800
com.sun.faces. resourceUpdateCheckPeriod2.0Frequency in minutes to check for changes to webapp artifacts that contain resources. 0 means never check for changes. -1 means always perform a new lookup when finding resources.5
com.sun.faces.compressableMimeTypes2.0Comma-seperated list of compressable mime types. No compression if ProjectStage is "Development"null
com.sun.faces.expressionFactory2.0Expression factory implementation class.com.sun.el .ExpressionFactoryImpl
com.sun.faces.duplicateJARPattern1.2 and 2.0Regular expression to determine if two URLs point to the same jar. Set by JBoss JSF Deployer.^tmp\d+(\S*\.jar)
com.sun.faces.faceletFactory2.0Set the FaceletFactory impl class.null
com.sun.faces.enableHtmlTagLibValidator2.0Enable validation of standard Html TagLibs.false
com.sun.faces.enableCoreTagLibValidator2.0Enable validation of standard Core TagLibs.false
com.sun.faces. registerConverterPropertyEditors2.0If true, allow EL Coercion to use JSF Custom converters.false
com.sun.faces.enableGroovyScripting2.0If true, allow Groovy.false
com.sun.faces. generateUniqueServerStateIds2.0If true, generate random server state Ids. If false, create Ids sequentially.true
com.sun.faces. autoCompleteOffOnViewState2.0If false, don't use autocomplete="off" when saving view state.true
com.sun.faces.allowTextChildren2.0If true, allow children of h:inputText and h:outputText to be rendered. In 1.2, they would always be rendered before the value of tag. In 2.0, they will not be rendered at all unless this flag is set.false


5.3. JBoss JSF Context Params

These context params are explained more in Chapter 3.

Table 5.3. 

Context ParamDescriptionDefault Value
org.jboss.jbossfaces.JSF_CONFIG_NAMEThe name of the JSF Configuration to use for this WAR.Mojarra-2.0
org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPLIf true, allow WAR to use the JSF implementation found in WEB-INF/lib.false

转载于:https://my.oschina.net/zhaoqian/blog/382928

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
对于Spring Boot整合JSF,你可以按照以下步骤进行操作: 1. 添加JSF依赖:在pom.xml文件中,添加JSF的依赖项,如下所示: ```xml <dependency> <groupId>javax.faces</groupId> <artifactId>javax.faces-api</artifactId> <version>2.3</version> </dependency> ``` 2. 配置JSF Servlet:在Spring Boot的配置类中,添加以下配置,以将JSF Servlet映射到`/javax.faces`路径下: ```java import javax.faces.webapp.FacesServlet; import org.springframework.boot.web.servlet.ServletRegistrationBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration public class JsfConfig { @Bean public ServletRegistrationBean<FacesServlet> facesServletRegistration() { ServletRegistrationBean<FacesServlet> registration = new ServletRegistrationBean<>(new FacesServlet(), "*.jsf"); registration.setName("FacesServlet"); return registration; } } ``` 3. 配置JSF View Resolver:在Spring Boot的配置类中,添加以下配置,以将JSF视图解析为`.xhtml`文件: ```java import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.ViewResolver; import org.springframework.web.servlet.view.InternalResourceViewResolver; @Configuration public class JsfConfig { @Bean public ViewResolver internalResourceViewResolver() { InternalResourceViewResolver resolver = new InternalResourceViewResolver(); resolver.setViewClass(JsfView.class); resolver.setPrefix("/WEB-INF/views/"); resolver.setSuffix(".xhtml"); return resolver; } } ``` 4. 创建JSF视图:在`/WEB-INF/views/`目录下创建JSF视图文件,例如`hello.xhtml`,并在其中定义JSF组件。 现在,你已经成功地将Spring Boot与JSF整合起来了。你可以在JSF视图中使用JSF的标签和组件。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值