aspose file tools*
The moose likes Portals and Portlets and the fly likes Sharing data Between portlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Portals and Portlets
Bookmark "Sharing data Between portlets" Watch "Sharing data Between portlets" New topic
Author

Sharing data Between portlets

Abiodun Adisa
Ranch Hand

Joined: Jan 17, 2002
Posts: 495
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
Ravi Kumar Ravuru
Ranch Hand

Joined: Apr 18, 2002
Posts: 176
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
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Sharing data Between portlets