本文整理汇总了Java中javax.faces.bean.ApplicationScoped类的典型用法代码示例。如果您正苦于以下问题:Java ApplicationScoped类的具体用法?Java ApplicationScoped怎么用?Java ApplicationScoped使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ApplicationScoped类属于javax.faces.bean包,在下文中一共展示了ApplicationScoped类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: jsfScopeAnnotationsConfigurer
import javax.faces.bean.ApplicationScoped; //导入依赖的package包/类
@Bean
@ConditionalOnProperty(value = "jsf.scope-configurer.jsf.enabled", havingValue = "true", matchIfMissing = true)
public static BeanFactoryPostProcessor jsfScopeAnnotationsConfigurer(Environment environment) {
CustomScopeAnnotationConfigurer scopeAnnotationConfigurer = new CustomScopeAnnotationConfigurer();
scopeAnnotationConfigurer.setOrder(environment.getProperty("jsf.scope-configurer.jsf.order", Integer.class, Ordered.LOWEST_PRECEDENCE));
scopeAnnotationConfigurer.addMapping(NoneScoped.class, ConfigurableBeanFactory.SCOPE_PROTOTYPE);
scopeAnnotationConfigurer.addMapping(RequestScoped.class, WebApplicationContext.SCOPE_REQUEST);
scopeAnnotationConfigurer.addMapping(javax.faces.bean.ViewScoped.class, ViewScope.SCOPE_VIEW);
scopeAnnotationConfigurer.addMapping(javax.faces.view.ViewScoped.class, ViewScope.SCOPE_VIEW);
scopeAnnotationConfigurer.addMapping(SessionScoped.class, WebApplicationContext.SCOPE_SESSION);
scopeAnnotationConfigurer.addMapping(ApplicationScoped.class, WebApplicationContext.SCOPE_APPLICATION);
return scopeAnnotationConfigurer;
}