File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Session tracking Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Session tracking" Watch "Session tracking" New topic
Author

Session tracking

Sean Thornton
Greenhorn

Joined: Jun 18, 2002
Posts: 5
How does JSF maintain a session? I know that when working with the servlet API your supposed to call request.getSession(). Does JSF do this for you automatically?
Varun Khanna
Ranch Hand

Joined: May 30, 2002
Posts: 1400
JSF is built over Servlets/JSP. It uses HttpSession only.


- Varun
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

Yes, JSF uses HttpSession, but doesn't give you transparent access to it. Everything in JSF is handled via the managed-beans. So if you want something stored in the session give the managed-bean session scope.

IF you just can't live without manipulating the HttpSession directly you can do:

session = (HttpSession)FacesContext.getCurrentIstance().getExternalContext().getSession();

you can also get things like the request and response objects as well from the external context.


GenRocket - Experts at Building Test Data
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Session tracking