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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to