java – 从JSF请求中检索会话ID值

如何在JSF托管的bean中检索会话ID值?
FacesContext fCtx = FacesContext.getCurrentInstance();
HttpSession session = (HttpSession) fCtx.getExternalContext().getSession(false);
String sessionId = session.getId();
翻译自:https://stackoverflow.com/questions/772541/retrieving-session-id-value-from-a-jsf-request

转载注明原文:java – 从JSF请求中检索会话ID值