Which portal are you using? Many portals have a setting to allow
portlets to share session attrs.  If your portlets can share attrs
then I'd assume you could grab it out of http session.



On 11/10/08, Roland J <[EMAIL PROTECTED]> wrote:
>
> Hi Claude,
>
> thank you for your response. The check of the session shows that my custom
> attributes aren't present in the session. It seems to be the portalSession
> not the httpSession.
>
> I used the following code in my portlet:
>
> request.getPortletSession().setAttribute("session_attr",
> request.getParameter("session_attr"), PortletSession.APPLICATION_SCOPE)
>
> Any idea how to pass my values into the portalSession or read out the
> httpSession in the header.vm?
>
> Roland
>
>
>
> CloD wrote:
>>
>> Hi.
>>
>> If you use the VeocityViewServlet from velocity-tools, all the
>> following:
>>
>> $session_attr
>> $session.getAttribute("session_attr")
>> $request.getSession().getAttribute("session_attr")
>> $request.session.getAttribute("session_attr")
>>
>> should work.
>>
>> You can try to check what is inside the session with the following
>> fragment of code:
>>
>> <ul>
>> #foreach($name in $session.getAttributeNames())
>>   <li> $name = $session.getAttribute($name) </li>
>> #end
>> </ul>
>>
>>
>>   Claude
>>
>> On lun, 2008-11-10 at 04:24 -0800, Roland J wrote:
>>> Hi,
>>>
>>> I have a problem getting custom values from the httpSession (NOT the
>>> portletSession) in the header.vm
>>> I tried different options like:
>>>
>>> 1. #set( $s_NO = $request.session.getAttribute("session_attr") )
>>> 2. #set( $s_NO = $request.getSession().getAttribute("session_attr") )
>>> 3. #set( $s_NO = $session.getAttribute("session_attr") )
>>> 4. #set( $s_NO = $session.session_attr )
>>>
>>> with the same result. $s_NO is always empty.
>>> I also tried to import a custom jsp file with the import directive to
>>> read
>>> out my Session attributes
>>>
>>> $import.read("http://localhost:8080/jetspeed/decorations/layout/ls1/file.jsp";)
>>>
>>>
>>> However  <%= session.getAttribute("session_attr") %> returns "null"
>>>
>>>
>>> Could someone respond with a solution?
>>>
>>> Thanks
>>> Roland
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>>
>
> --
> View this message in context:
> http://www.nabble.com/Getting-attributes-from-HttpSession-in-header.vm-tp20418973p20419809.html
> Sent from the Velocity - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-- 
Sent from my mobile device

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to