This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes JSF and the fly likes JSF session management Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSF
Bookmark "JSF session management" Watch "JSF session management" New topic
Author

JSF session management

Adnan Gondal
Ranch Hand

Joined: Apr 30, 2011
Posts: 32
Hi all!
Please tell me method of handling sessions in jsf?
Thanks in advance.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16095
    
  21

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
GeeCON Prague 2014
 
subject: JSF session management