• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSF session management

 
Adnan Gondal
Ranch Hand
Posts: 35
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all!
Please tell me method of handling sessions in jsf?
Thanks in advance.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17616
39
Android Eclipse IDE Linux
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, it depends on what you mean by "handling sessions". Sessions in JSF are exactly the same things as Sessions without JSF. The main differences are:

1. JSF may automatically construct a session if a backing bean is referenced in session scope - since obviously a session bean needs a session to live in!

2. JSF is more likely to need session-scope beans than traditional J2EE apps, so see #1.

3. JSF doesn't have an API that makes it easy to get to the raw HTTP service objects (HTTPServletRequest/Response and HttpSession). So a little extra code is required to directly access the Session itself. I usually define a service class to do that - it keeps server-specific code out of my beans, making them easier to test them offline.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic