| Author |
HttpSession in bean
|
Howard Ralston
Ranch Hand
Joined: Jun 25, 2001
Posts: 105
|
|
If you have a String object in a session that was put there earlier in an Action object, e.g. session.setAttribute("MyVariable", "MyString"), is it possible to retrieve "MyString" from the session in a non-form bean? I want to use the bean tag on a jsp but don't want to use code in the jsp to send the session to the bean, e.g. myBean.setSession(session). Many thanks!
|
<a href="http://www.getlocaldeals.com" target="_blank" rel="nofollow">Free local coupons</a>
|
 |
Adam Kreiss
Ranch Hand
Joined: Sep 12, 2005
Posts: 35
|
|
If you put a bean into the session (as opposed to a string), you can reference it with a <bean:whatever> tag. All you have to do is specify the name and set scope="session". Although I'm not sure thats what you need.
|
 |
Howard Ralston
Ranch Hand
Joined: Jun 25, 2001
Posts: 105
|
|
Thanks for the reply. What I wanted to know is: how do I access any object in the session when I am coding a bean? If I have a Customer object stored in the session, how do I access it from a bean? I want to get values from the Customer object for comparison in the bean, then depending on the result, write a message in the jsp with the bean.
|
 |
 |
|
|
subject: HttpSession in bean
|
|
|