本文整理匯總了Java中javax.faces.bean.SessionScoped類的典型用法代碼示例。如果您正苦於以下問題:Java SessionScoped類的具體用法?Java SessionScoped怎麽用?Java SessionScoped使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
SessionScoped類屬於javax.faces.bean包,在下文中一共展示了SessionScoped類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: jsfScopeAnnotationsConfigurer
import javax.faces.bean.SessionScoped; //導入依賴的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;
}
示例2: annotationsToExclude
import javax.faces.bean.SessionScoped; //導入依賴的package包/類
/**
* Ignore ViewScoped, SessionScoped, RequestScoped and NoneScoped annotations
* because spring will take care of them.
* @return set of annotations to exclude from handlesType
*/
private Set<Class<? extends Annotation>> annotationsToExclude() {
Set<Class<? extends Annotation>> result = new HashSet<>();
if (this.jsfAnnotatedClassFactoryConfiguration.isExcludeScopedAnnotations()) {
result.add(ViewScoped.class);
result.add(SessionScoped.class);
result.add(RequestScoped.class);
result.add(NoneScoped.class);
}
return result;
}