我們最近從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