Get your CodeRanch badge!*
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: 15641
    
  15

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSF session management
 
Similar Threads
Accessing bean data within a scriptlet
JSF: simple "required" validation problem
DataTable,DataGrid and Databindings in JAVA.
Spring+ hibernate or JSF+EJB3
JSF 1.1 or JSF 1.2