jsf session的獲取和添加


轉載地址: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"));  

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM