portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gudiyella, Pavan" <PGudiye...@Tribune.com>
Subject getting session attribute or request attribute in header.vm
Date Wed, 07 Feb 2007 19:44:22 GMT
Hi,

I am having trouble getting the session attribute in velocity files in
jetspeed2.

I am setting an attribute in session in portlet.  To be specific I am
putting in doView() method

request.getPortletSession().setAttribute("session_attr", "sessionValue",
PortletSession.APPLICATION_SCOPE);


I am trying to access it in header.vm  as follows.  Listing all the options
that I tried.

1. $request.session.getAttribute("session_attr")

2. $request.getSession().getAttribute("session_attr")

3. #set($reqCont =
$renderRequest.getAttribute("org.apache.jetspeed.request.RequestContext"))
	reqCont session id is  $reqCont.getRequest().getSession().getId()
	reqCont attribute is
$reqCont.getRequest().getSession().getAttribute("session_attr")

When I print the session Id in the portlet code and in the velocity code, it
is SAME
However, I am unable to retrieve session attributes or request attributes
that were put in portlet in header.vm.

Could someone respond with a solution?

Thanks
Pavan Kumar Gudiyella
Tribune Media Services
pgudiyella@tribune.com
(312)-222-3192

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message