WebSphere Portal Server - Session Attributes

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere Portal Server > September 2005 > Session Attributes





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Session Attributes
Arnaud Denagbe

2005-09-17, 2:48 am

Hi,

I am using WPS 5.0.2. I configured a page with several portlets.
The problem is that when I set an attribute in the session object from a
certain
portlet request.getSession().setAttribute("attr", "blabla"), I cannot access
the
attribute from another portlet. If I try
request.getSession().getAttribute("attr") from
another portlet, it returns null. The portlets seems to access different
session objects,
even if the id is the same. It used to work with the 4.1 version, so I am
wondering if I forgot a setting of WPS.

Thanks for any hint or solution.

Arnaud


2005-09-28, 6:04 pm

The getSession() method from a portlet request returns an instance of PortletSession (which implements HttpSession!), not the HttpSession instance for the user, so anything you store there will only be available to that portlet instance. You need to do s
omething "illegal" to get the HttpSession like:

HttpSession s = com.ibm.wps.pb.utils.portlet.PortletUtils.getHttpSession(request.getPortletSession());

I found this method by digging around in portal jars, so use this at your own risk. It could break in 5.1.

2005-09-29, 7:52 am

Hi,

Try using PortletData instead of PortletSession, it may help.

Regards,
GSR
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com