如何在会话中获取所有初始化的托管bean? 以下代码每次都会崩溃JVM。
FacesContext facesContext=FacesContext.getCurrentInstance();
com.sun.faces.application.ApplicationAssociate application =
ApplicationAssociate.getInstance(facesContext.getExternalContext());
答案 0 :(得分:1)
你不能使用像
这样的东西 FacesContext context = FacesContext.getCurrentInstance();
HttpSession session = (HttpSession) context.getExternalContext().getSession(true);
Enumeration mySessionBeans = session.getAttributeNames();