本文整理匯總了Java中javax.faces.bean.ViewScoped類的典型用法代碼示例。如果您正苦於以下問題:Java ViewScoped類的具體用法?Java ViewScoped怎麽用?Java ViewScoped使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ViewScoped類屬於javax.faces.bean包,在下文中一共展示了ViewScoped類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addViewScoped
import javax.faces.bean.ViewScoped; //導入依賴的package包/類
/**
* javax.faces.bean.ViewScoped is no CDI Scope.
* We need to add it programmatically to CDI.
*/
public void addViewScoped(@Observes BeforeBeanDiscovery beforeBeanDiscovery)
{
isActivated = ClassDeactivationUtils.isActivated(getClass());
if (isActivated)
{
//this extension is only needed if the cdi-based view-scope handling isn't delegated to jsf 2.2+
isActivated = !JsfUtils.isViewScopeDelegationEnabled();
}
if (!isActivated)
{
return;
}
beforeBeanDiscovery.addScope(ViewScoped.class, true, true);
}
示例2: annotationsToExclude
import javax.faces.bean.ViewScoped; //導入依賴的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;
}
示例3: addScope
import javax.faces.bean.ViewScoped; //導入依賴的package包/類
public void addScope(@Observes final BeforeBeanDiscovery event) {
event.addScope(ViewScoped.class, true, true);
}
示例4: getScope
import javax.faces.bean.ViewScoped; //導入依賴的package包/類
@Override
public Class<? extends Annotation> getScope() {
return ViewScoped.class;
}
示例5: addScope
import javax.faces.bean.ViewScoped; //導入依賴的package包/類
public void addScope(@Observes final BeforeBeanDiscovery event)
{
event.addScope(ViewScoped.class, true, true);
}
示例6: getScope
import javax.faces.bean.ViewScoped; //導入依賴的package包/類
/**
* {@inheritDoc}
*/
@Override
public Class<? extends Annotation> getScope()
{
return ViewScoped.class;
}