JSF 2 - 未检测到 @ManagedBean [英] JSF 2 - @ManagedBean not detected

查看:23
本文介绍了JSF 2 - 未检测到 @ManagedBean的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 ParentBean 类,它具有 @ManagedBean 注释.如果我对此类进行子类化,则 ChildBean 不会继承 @ManagedBean 批注,尽管 @ManagedBean 批注具有元批注 继承.

我错过了什么?

<前>JSF 2.0莫哈拉 2.0.6 |JBoss 5.1.0.GAEclipse Indigo - 版本号:20110615-0604

仍在寻找解决方案......

解决方案

阅读本文后 问题 并阅读了 Mojarra 的一些源代码(参见 问题),我认为 Mojarra 实际上可能不会彻底扫描类(为了加载性能).

所以我的猜测是,对于一个给定的类,Mojarra AnnotationScanner 留在这个类上,它不会扫描同一个类的层次结构.

这就是为什么我的 ChildBean 不被识别为 ManagedBean.

I have a ParentBean class which has the @ManagedBean annotation. If I subclass this class, the ChildBean does not inherit the @ManagedBean annotation although the @ManagedBean annotation has the meta-annotation Inherited.

What am I missing ?

JSF 2.0
Mojarra 2.0.6 | JBoss 5.1.0.GA
Eclipse Indigo - Build id: 20110615-0604

EDIT: Still looking for a solution ...

解决方案

After reading this question and reading a little bit the source code from Mojarra (see question), I think Mojarra may not actually scan thoroughly the classes (for loading performance).

So my guess is that for one given class, the Mojarra AnnotationScanner stays on this class and it doesn't scan the hierarchy of this same class.

This is why my ChildBean is not recognized as a ManagedBean.

这篇关于JSF 2 - 未检测到 @ManagedBean的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆