0
我用下面的代碼intialized一個變量ServletContext
聽衆:如何在jsf中獲取應用程序範圍變量?
sce.getServletContext().setAttribute("foo", "someValue");
所以,我現在可以使用下面的代碼獲取的價值:
FacesContext.getCurrentInstance().getExternalContext().getApplicationMap().get("foo");
現在,我要訪問此值在其他一些不是FacesContext
的課程中,或者不是控制器。我怎樣才能做到這一點?