and i am gettign null value for String a & b. I tried to print session id on both places and found that both the IDs are different. It means the new session is getting created in action. But i neither used "session.invalidate()" nor "session.timeout()".
So why this new session is getting created in action?
Why are you setting any session values in the JSP at all? That kind of behavior should live in Java code, not JSP code.
Bhagat Singh Rawat
Joined: Apr 04, 2009
David Newton wrote:Why are you setting any session values in the JSP at all? That kind of behavior should live in Java code, not JSP code.
Absolutely correct David!!! Whatever scope you will declare there in the struts config file, it will behave like that, you need not to write any extra code to maintain session.
Joined: Feb 17, 2010
Thaks for your replies..
@ Bhagat Singh Rawat
In Action I am trying to retrieve those values.
@ David Newton
Actually this is the part of requirements. I need to use these values across the application. So on the first page i need to set these values and use it anywhere in the application.
So, I think session is the right approach to complete this requirement.right?
If you have any other idea by which i can fulfill this requirement please suggest.