This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to handle session in jsf??  RSS feed

 
Balaji Kadam
Ranch Hand
Posts: 31
Hibernate Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

In servlet & jsp use httpsession to handle session. we create Httpsession's object and sets and gets attribute. Even we can check session attribue and decide whether page should be show to user or error/login page show.

How this functionality handle in jsf?

-Balaji
 
Tim Holloway
Bartender
Posts: 18662
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JacaRanch, Balaji!

JSF uses Sessions automatically when you reference backing beans that are defined with session scope. You don't need to write any session code. In fact, one of the great frustrations for a lot of JSF users is that Session scope is required in many cases where Request scope would have been sufficient when using simpler J2EE application frameworks.

The only real issue here comes if you mix traditional servlets/JSPs with J2EE. Because J2EE will create sessions automatically as needed, code that expects a session doesn't exist yet will be surprised. This most commonly happens when people are expecting session to be the same thing as "logged in".
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!