Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

JSF--> where to store reference to Stateful Session bean

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I want to store the reference of a Stateful Session Bean for maintaining state. I know that I can put in a servlet some code to store the reference to the Stateful bean in session.
Then on subsequent invocation servlet can check if the Stateful bean reference exists in HttpSession, and use it to get back to the same Stateful bean. This will work on Struts.


But in JSF we have Faces Servlet passing the control to managed beans. These managed beans can then use Business Delegate (Which uses ServiceLocator) to get to the EJBs.
Managed Beans get bounded value from JSP instead of HTTP Session.


In the above scenario (JSF lifecycle) where/how can i store the Stateful Session Bean reference in HttpSession so that client can go back to the same Stateful Bean?

Any response is much appreciated and Have a great weekend

SCJP 5 91%
SCEA Part 1 93%
 
James Owen
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any help guys?
 
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at the API, specifically

FacesContext
ExternalContext

 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Managed Beans can access Http Session too throught FacesContext:




You can try JBoss Seam too.
 
Blood pressure normal? What do I change to get "magnificent"? Maybe this tiny ad?
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic