Hi guys.
I am trying to set some values in session in my
JSP using
request.getSession().setAttribute(USER_ID_KEY, userId);
request.getSession().setAttribute(COMPANY_ID_KEY, companyId);
Then using anchor tag i am calling my action(
Struts 1.2). In my action i am trying to retrieve these values using
HttpSession session =request.getSession(false);
a= (
String)session .getAttribute("userId");
b=(String)request.getSession().getAttribute("companyId");
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?
My struts-config.xml is like
<action path="/abc" scope="request" type="myPkg.struts.action.myAction">
<forward name="FIRSTTIME" path="/firstTime.jsp" />
</action>
I also tried scope="session" but didnt succeed in that also.
I am facing this issue from last 2 days bt i didnt gt any solution. Please help me. Any kind of help is appreciated.
Thanks & Regards,
DPAK.