EJB design: how can get session object's of web tier in EJB
- Posted by: prabhu biradar
- Posted on: October 07 2003 05:03 EDT
I face prob.. where i want to get session contents from my
web tier please sugg.. me how i can play with session object
- how can get session object's of web tier in EJB by Paul Strack on October 07 2003 11:44 EDT
- how can get session object's of web tier in EJB by prabhu biradar on October 08 2003 00:24 EDT
The best way to do this is to pass the objects as method parameters from your Web Tier to your EJB tier.
Object value = session.getAttribute("value");
This is probably not the answer you were hoping for, but if you want good seperation of tiers, it is your only option.
but do u think I should import web tier session API in EJB ?
> but do u think I should import web tier session API in EJB ?
iI do't think this is soln..
Race Condition is right. Importing the servlet session in your EJB layer will almost certainly fail to work. Pass your data between tiers explicitly as method parameters.
If your really must pass the entire servlet session between your tiers, store all your servlet session data in a Map, and pass this entire map between your tiers. But I am sure if you spend more time thinking about your design, you can come up with something better than that.