• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Sessions in JSF

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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);
 
Bartender
Posts: 543
4
Netbeans IDE Redhat Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Blueberry pie is best when it is firm and you can hold in your hand. Smell it. And smell this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic