我们最近从JSF 1.2升级到2.1。我们在WebSphere 6.1上运行,其具有的Servlet 2.4使用Servlet 2.4访问JSF2.1中的另一个托管Bean
我们使用以下库: MyFaces的2.1.1 EL-API 2.2
现在我们唯一的问题是,我们不能访问其他备份豆类就像我们之前做过的:
public static Object getBackingBean(String pName) {
ELContext elContext = FacesContext.getCurrentInstance().getELContext();
Object ret = elContext.getELResolver().getValue(elContext, null, pName);
return ret;
}
这将始终返回null。 我们也试过:
Beanclass bean = (Beanclass) FacesContext.getCurrentInstance().getApplication()
.getELResolver().getValue(elContext, null, "beanclass");
哪些返回null。
我们已经尝试了@ManagedProperty注释,但这显然是一个Servlet 2.5功能。默认情况下,ELContext是否可能使用DI?有没有办法在JSF2.1和Servlet 2.4中获得另一个支持Bean的实例?谢谢!
谢谢 - 我已经交叉发布它在MyFaces用户列表 – toby