How do I retrieve the session ID value inside a JSF managed bean?
+5
A:
FacesContext fCtx = FacesContext.getCurrentInstance();
HttpSession session = (HttpSession) fCtx.getExternalContext().getSession(false);
String sessionId = session.getId();
Damo
2009-04-21 13:26:39
I was just about to answer with almost the exact same code :)
Yuval A
2009-04-21 13:30:05