• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Sharing data Between portlets

 
Ranch Hand
Posts: 495
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using two different portlets in my Portal Application i intend to share data between this two portlets, I tried

PortletRequest request=(PortletRequest)FacesContext.getCurrentInstance().getExternalContext.getRequest();
PortletSession ps=request.getPortletSession();
ps.setAttribute("Test","Test");

But unfortunately i am unable to retrieve this in my other Portlet, I am using websphere portal Server 6
 
Ranch Hand
Posts: 176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

You can use application scope of portlet session to share the data between the portlets.You can go through JSR 168 Specs for the same.

Ravi
 
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You'll need to do something like this:

String visitCount =
(String)session.getAttribute("timesvisited",PortletSession.APPLICATION_SCOPE);


PortletSession.APPLICATION_SCOPE needs to go in there.

Here's a little tutorial on understanding the various Portlet scopes:

Understanding the JSR168 PortletSession Scopes

-Cameron McKenzie
reply
    Bookmark Topic Watch Topic
  • New Topic