Retrieving session ID value from a JSF request

后端 未结 2 562
悲&欢浪女
悲&欢浪女 2021-01-03 22:14

How do I retrieve the session ID value inside a JSF managed bean?

相关标签:
2条回答
  • 2021-01-03 22:35

    You try

    {String uuidFc = FacesContext.getCurrentInstance().getExternalContext().getSessionId(true); }

    This line return the facesContext sessionId value

    0 讨论(0)
  • 2021-01-03 22:39
    FacesContext fCtx = FacesContext.getCurrentInstance();
    HttpSession session = (HttpSession) fCtx.getExternalContext().getSession(false);
    String sessionId = session.getId();
    
    0 讨论(0)
提交回复
热议问题