我目前正在写一个简单的JSF 2应用程序为WAS 7.当我通过faces-config.xml中定义bean,一切都很正常JSF 2个注解与WebSphere 7(JEE5,JAVA 1.6)
<managed-bean>
<managed-bean-name>personBean</managed-bean-name>
<managed-bean-class>com.prototype.beans.PersonBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
当我尝试使用下面的注释时,应用程序失败。
package com.prototype.beans;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
@ManagedBean(name="personBean")
@RequestScoped
public class PersonBean {
....
}
我已经设置了WAS类加载器父最后,并在钻嘴鱼科2.X加载日志验证。
[5/17/10 10:46:59:399 CDT] 00000009 config I Initializing Mojarra 2.0.2 (FCS b10) for context '/JSFPrototype'
然而,当我尝试使用的应用程序(它已与基于XML的配置工作),我看到下面的
[5/17/10 10:48:08:491 CDT] 00000016 lifecycle W /pages/inputname.jsp(16,7) '#{personBean.personName}' Target Unreachable, identifier 'personBean' resolved to null
org.apache.jasper.el.JspPropertyNotFoundException: /pages/inputname.jsp(16,7) '#{personBean.personName}' Target Unreachable, identifier 'personBean' resolved to null
任何人都知道什么回事?
不,你错了名字。 – BalusC 2011-08-04 17:07:07