• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

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

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Any help guys?
 
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Take a look at the API, specifically

FacesContext
ExternalContext

 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Managed Beans can access Http Session too throught FacesContext:




You can try JBoss Seam too.
 
They gave me pumpkin ice cream. It was not pumpkin pie ice cream. Wiping my tongue on this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic