本文整理匯總了Java中javax.faces.bean.RequestScoped類的典型用法代碼示例。如果您正苦於以下問題:Java RequestScoped類的具體用法?Java RequestScoped怎麽用?Java RequestScoped使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
RequestScoped類屬於javax.faces.bean包,在下文中一共展示了RequestScoped類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: jsfScopeAnnotationsConfigurer
import javax.faces.bean.RequestScoped; //導入依賴的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: init
import javax.faces.bean.RequestScoped; //導入依賴的package包/類
@PostConstruct
protected void init()
{
Map<String, Class> values = new HashMap<String, Class>();
values.put("value", RequestScoped.class);
Class<? extends Annotation> initializedAnnotationClass =
ClassUtils.tryToLoadClassForName("javax.enterprise.context.Initialized");
if (initializedAnnotationClass != null)
{
this.initializedAnnotationInstance = AnnotationInstanceProvider.of(initializedAnnotationClass, values);
}
Class<? extends Annotation> destroyedAnnotationClass =
ClassUtils.tryToLoadClassForName("javax.enterprise.context.Destroyed");
if (destroyedAnnotationClass != null)
{
this.destroyedAnnotationInstance = AnnotationInstanceProvider.of(destroyedAnnotationClass, values);
}
}
示例3: annotationsToExclude
import javax.faces.bean.RequestScoped; //導入依賴的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;
}