File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

JSF session management

Adnan Gondal
Ranch Hand

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

Joined: Jun 25, 2001
Posts: 17417

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.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: JSF session management
jQuery in Action, 3rd edition