如何在JSF托管Bean中检索 session ID值? 最佳答案 FacesContext fCtx = FacesContext.getCurrentInstance(); HttpSession session = (HttpSession) fCtx.getExternalContext().getSession(false); String sessionId = session.getId();