aspose file tools*
The moose likes JSF and the fly likes Sessions in JSF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Sessions in JSF" Watch "Sessions in JSF" New topic
Author

Sessions in JSF

Renjith Jose
Greenhorn

Joined: Jun 21, 2011
Posts: 2
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

Joined: Aug 06, 2010
Posts: 543
    
    4

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().


Oracle Certified Professional: Java SE 6 Programmer && Oracle Certified Expert: (JEE 6 Web Component Developer && JEE 6 EJB Developer)
Renjith Jose
Greenhorn

Joined: Jun 21, 2011
Posts: 2
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...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Sessions in JSF