Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sessions in JSF

 
Renjith Jose
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,
I need to know the difference between following statements

HttpSession session = (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(true);
and
HttpSession session = (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false);
 
Dieter Quickfend
Bartender
Posts: 543
4
Java Netbeans IDE Redhat
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
same as the HttpRequest.getSession(boolean) methods. It's the same as getSession(), except when false is passed as a parameter, the container will not create a new session if there is no session, and will instead return null. getSession(true) is identical to getSession().
 
Renjith Jose
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dieter Quickfend wrote:same as the HttpRequest.getSession(boolean) methods. It's the same as getSession(), except when false is passed as a parameter, the container will not create a new session if there is no session, and will instead return null. getSession(true) is identical to getSession().


Thanks...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic