This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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
 
Similar Threads
RAD and Portal Test Envoirmnemnt -Unable to Run a simple Portlet
JSF-portlet request response object in jsp
Websites based on portlets!!
How to pass parameters between portlets?
Application Scope Session in IBM portal server