【发布时间】:2011-11-23 01:34:38
【问题描述】:
使用 JBoss 6.0.0.Final、Richfaces 3.3.3.Final、MyFaces 2.0.6、facelets 1.1.15.B1(RF 3 的限制)。
我正在进行一个遗留项目,其中包含在faces-config.xml 中定义的数百个 bean。我想保留 faces-config.xml 中定义的那些,但对新 bean 使用注释。但是,当我尝试过这个时,我没有成功。注释定义的bean,即
@ManagedBean
@ViewScoped
public class Foobar implements Serializable {
// ...
}
无法从我的 JSF 页面访问 bean。我相信我已经使用正确的标头在我的 faces-config.xml 中指定了 2.0 版本。
<faces-config
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
version="2.0">
我还需要在faces-config.xml 中做些什么来允许使用注释吗?
【问题讨论】: