• 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 object to EJB

 
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All

Is it possible to propogate a HttpSession object to EJB tier.
If yes does it need to be a DTO.

What I am trying to ask is having a stateless business layer (EJB tier) &
having the session maintained at the web tier only.


Hope this question does not sound absurd.

If somebody has worked on anything similiar do post your comments

Bye
Mohit
 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mohit,
It would be a bad practice to pass HttpSession Object reference to the EJB tier. This will mean that ejbs cannot be accessed without a web application.
If session has to be passed to the EJB tier in a different JVM then it has to be Serializable and so the objects in the session.

What I am trying to ask is having a stateless business layer (EJB tier) &
having the session maintained at the web tier only.


This confuses me. In case a why do you need to pass a HttpSession object reference, just extract the state from the httpsession and pass it on to SLSB. If you have another client say SWING the state would have to be in that application.
 
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I agree. By doing so, you couple the network related object (HttpSession) with the business object and reduce the business object usability.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I agree with Pradeep that it is a bad design. You could propogate any object as long as the object is serializable.
You could design in such a way you seprate the web(presentation) and business layer completely and pass only the relevent data/objects not the entire httpsession.

I hope it was helpful.
 
Saf Syed
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I agree with Pradeep that it is a bad design. You could propogate any object as long as the object is serializable.
You could design in such a way you seprate the web(presentation) and business layer completely and pass only the relevent data/objects not the entire httpsession.

I hope it was helpful.
 
Been there. Done that. Went back for more. But this time, I took this tiny ad with me:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic