File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

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();

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

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.

Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968

You'll need to do something like this:

String visitCount =

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:
subject: Sharing data Between portlets
It's not a secret anymore!