當前位置: 首頁>>代碼示例>>Java>>正文


Java RequestScoped類代碼示例

本文整理匯總了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;
}
 
開發者ID:joinfaces,項目名稱:joinfaces,代碼行數:17,代碼來源:JsfScopeAnnotationsAutoConfiguration.java

示例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);
    }
}
 
開發者ID:apache,項目名稱:deltaspike,代碼行數:20,代碼來源:JsfRequestBroadcaster.java

示例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;
}
 
開發者ID:joinfaces,項目名稱:joinfaces,代碼行數:16,代碼來源:JsfClassFactory.java


注:本文中的javax.faces.bean.RequestScoped類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。