2009-04-21 105 views

回答

37
FacesContext fCtx = FacesContext.getCurrentInstance(); 
HttpSession session = (HttpSession) fCtx.getExternalContext().getSession(false); 
String sessionId = session.getId(); 
+3

我刚要回答几乎完全相同的代码:) – 2009-04-21 13:30:05