What is the use of session attribute in the project?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • srikanthbabu
    New Member
    • Jan 2011
    • 5

    #1

    What is the use of session attribute in the project?

    in my project we used the following code in many pages and i did not understand the use of this
    Code:
    HttpServletRequest request = (HttpServletRequest) FacesContext
    				.getCurrentInstance().getExternalContext().getRequest();
    		String path = request.getContextPath();
    		String basePath = request.getScheme() + "://" + request.getServerName()
    				+ ":" + request.getServerPort() + path;
    		this.basePath = basePath;
    
    		HttpSession session = (HttpSession) FacesContext.getCurrentInstance()
    				.getExternalContext().getSession(false);
    		SessionVO sessionBean = ((SessionVO) session.getAttribute("sessionDto"));
    		this.commentVO.setCurUserId(sessionBean.getUserId());
    Last edited by Markus; Feb 1 '11, 03:06 PM. Reason: Added [code] tags
Working...