如何在JSF托管bean中检索会话ID值?
答案 0 :(得分:40)
FacesContext fCtx = FacesContext.getCurrentInstance();
HttpSession session = (HttpSession) fCtx.getExternalContext().getSession(false);
String sessionId = session.getId();
答案 1 :(得分:0)
您尝试
{String uuidFc = FacesContext.getCurrentInstance()。getExternalContext()。getSessionId(true); }
此行返回facesContext sessionId值