portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Sean Taylor <da...@bluesunrise.com>
Subject Re: getting session attribute or request attribute in header.vm
Date Wed, 07 Feb 2007 22:05:15 GMT

On Feb 7, 2007, at 11:44 AM, Gudiyella, Pavan wrote:

> 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?
>

There was just a thread on the Jetspeed User yesterday that could  
help you.
See the thread titled "How can I hide portlet programmatically"  
initiated by Vitaly.
He has come up with a solution that may help you




---------------------------------------------------------------------
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