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

问题描述

限时删除!!

我有一个 ParentBean 类,其中包含注释。如果我将此类子类化,则 ChildBean 不会继承@ManagedBean注释,尽管@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.

什么是我错过了?


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

编辑:仍在寻找解决方案...

Still looking for a solution ...

推荐答案

阅读完并从Mojarra中读取一些源代码(参见),我认为Mojarra实际上可能没有彻底扫描类(对于加载性能) 。

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).

所以我的猜测是,对于一个给定的类,Mojarra AnnotationScanner 保留在这个类上,它没有' t扫描同一个类的层次结构。

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.

这就是我的 ChildBean 未被识别为<$ c的原因$ c> ManagedBean 。

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

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

1403页,肝出来的..

09-07 01:30