Hi Srini, I guess the portlet session must be different from the requestContext.getRequest().getSession() even though sessionids could be the same one. That's because requestContext.getRequest().getSession() will return an http session on the portal web application, while the portlet session is from another servlet application (portlet application). HTTP session is not shared between multiple web applications. So, if you should set an attribute in a valve which runs in the portal app, then you should use portal's http session via requestContext.getRequest().getSession().
Regards, Woonsan --- On Wed, 12/1/10, SriniPitta <[email protected]> wrote: > From: SriniPitta <[email protected]> > Subject: httpsession vs portletsession > To: [email protected] > Date: Wednesday, December 1, 2010, 5:38 PM > > Hi, > > The values stored in httpsession are not being fetched from > portletsession. > I have stored a value in httpsession inside my valve and > was not able to get > the same from portletsession. > > However,the sessionid's of httpsession and portletsession > remained the same. > I printed the sessionid's in my portlet and both are same > session objects. > I did not understand why was I not able to get the value > stored in the > session inspite of both being the same session objects. > > ================== > doView(RenderRequest request...){ > PortletSession session = request.getPortletSession(); > > session.getAttribute("key"); // returns me null > > > org.apache.jetspeed.request.RequestContext requestContext > = > > (RequestContext) > request.getAttribute(RequestContext.REQUEST_PORTALENV); > > HttpSession httpSession = > requestContext.getRequest().getSession(); > HttpSession httpSession = > requestContext.getRequest().getSession(); > > httpSession.getAttribute("key"); returns me the value > > ================================== > > Thanks, > Srini. > -- > View this message in context: > http://old.nabble.com/httpsession-vs-portletsession-tp30350795p30350795.html > Sent from the Jetspeed - User mailing list archive at > Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
