public static <T> T getManagementBean(FacesContext ctx, Class<T> clazs) {
ManagedBean annotation = clazs.getAnnotation(ManagedBean.class);
if (annotation == null) {
return null;
}
Object mgmtBean = ctx.getELContext().getELResolver().getValue(ctx.getELContext(), null, annotation.name());
return clazs.cast(mgmtBean);
}
java类javax.faces.bean.ManagedBean的实例源码
JSFUtils.java 文件源码
项目:tianma
阅读 23
收藏 0
点赞 0
评论 0
MappedJsf2ScopeExtension.java 文件源码
项目:deltaspike
阅读 22
收藏 0
点赞 0
评论 0
private boolean isBeanWithManagedBeanAnnotation(ProcessAnnotatedType processAnnotatedType)
{
Class<?> beanClass = processAnnotatedType.getAnnotatedType().getJavaClass();
return beanClass.isAnnotationPresent(ManagedBean.class);
}