This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
James Owen
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?
 
J J Wright
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at the API, specifically

FacesContext
ExternalContext

 
Luciano A. Pozzo
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic