转载地址:http://hi.baidu.com/lvzhnan/item/c2a46115d235b70ad0d66d3f

jsf session 添加 获取

1、session的添加
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ExternalContext extContext =facesContext.getExternalContext();
    this.session =(HttpSession)extContext.getSession(true);
    this.session.setAttribute("user", this.userName);
    
    this.session.setAttribute("currentUser", loboUser);

 

2、session的读取

   FacesContext facesContext = FacesContext.getCurrentInstance();
   ExternalContext extContext =facesContext.getExternalContext();
   HttpSession session =(HttpSession)extContext.getSession(true); 
   //mes.setMesOperator(session.getAttribute("user").toString());
   String user = session.getAttribute("user").toString();

Integer.parseInt(request.getParameter("note_id"));  

 

相关文章:

  • 2021-11-08
  • 2021-12-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-27
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-12
  • 2022-02-28
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
相关资源
相似解决方案