本文整理汇总了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;
}