Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

HttpSession  RSS feed

 
sitaram irrinki
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to share an HtpSession b/w.
a jsp and Ejb.?
 
Kartik Patel
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No.

actually as per EJB and J2EE specs its not good design if you are sharing your session between ejb and jsp.

And when you pass session to the EJB , it will be pass by value... so any change you make in the session in EJB wll not get reflected to the JSP...

So according to me rethink on your design and find out some other way for passing session values to ejb...
 
Madhavan C
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
First of all it is not advised to acces EJB from JSP, to perform this task we can go for the "Session Facade"- design pattern.This pattern helps us to implement the MVC-model.Here you can also maintain the HTTP session's through the session bean which may inturn access the Entity-bean.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Madhavan",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
Forum Bartender
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!