//Setting Attribute in session.
String userID="Subin";
HttpSession session = (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false); session.setAttribute("userId", userID);
//Getting Attribute from the session.
HttpServletRequest hsr = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
String userName = (String) hsr.getSession().getAttribute("userId");
JSF Related topics: JCaptcha in JSF, Integrating Richfaces with JSF,Getting client and server sessionId in JSF,PopUp AlertMessagebox for JSF and more.....
Friday, May 21, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment