Session Attributes
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > WebSphere > WebSphere Portal Server > Session Attributes




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Session Attributes  
Arnaud Denagbe


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-17-05 07: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







[ Post a follow-up to this message ]



    Re: Session Attributes  


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-28-05 11:04 PM

The getSession() method from a portlet request returns an instance of Portle
tSession (which implements HttpSession!), not the HttpSession instance for t
he 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(req
uest.getPortletSession());

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





[ Post a follow-up to this message ]



    Re: Session Attributes  


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-29-05 12:52 PM

Hi,

Try using PortletData instead of PortletSession, it may help.

Regards,
GSR





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 06:45 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register