• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

HttpSession and Session Bean

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anyone please clarify me this question.
Whether the userstate maintained in HttpSession can be made avaiable in EJB Stateful/Stateless session bean?
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, the EJB doesn't have direct access to the HttpSession but you can pass the session to the EJB as a parameter (assuming everything in it is Serializable). Not a good thing to do though, since it ties your EJB method to a web client and any cahnges your EJB method makes to the HttpSession will not be reflected in the actual HttpSession itself.
[ March 19, 2007: Message edited by: Paul Sturrock ]
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So in that case, you would have to get the stuff out of the HttpSession, put it into some other class that you create, pass that to the EJB, do stuff, and put the changes into that new class, return that, then take it out of that object, and put it into the HttpSession.

Mark
 
Kalpana Balasubramanian
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the help.

I did that way only, I created a User class which is passed back and forth with the updated information. It is working fine.

Thanks again!
reply
    Bookmark Topic Watch Topic
  • New Topic