aspose file tools
The moose likes Portals and Portlets and the fly likes portlet communication - sending object not string... Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Portals and Portlets
Reply Bookmark "portlet communication - sending object not string..." Watch "portlet communication - sending object not string..." New topic
Author

portlet communication - sending object not string...

ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3829
Can we send any object other than string to one portlet from another portlet?

Thanks.
Mouli Velu
Greenhorn

Joined: Oct 06, 2005
Posts: 12
Hi,
you can pass the string message to the portlets in any of the portlet application. You can use DefaultPortletMessage interface for this.

But messages other than string can be passed to the same portlet application only. you can make use of PortletMessage interface for this.
I have done this in IBM Portlet API.


Regards<br />S.Mouli
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3829
Originally posted by Mouli Velu:
Hi,
you can pass the string message to the portlets in any of the portlet application. You can use DefaultPortletMessage interface for this.

But messages other than string can be passed to the same portlet application only. you can make use of PortletMessage interface for this.
I have done this in IBM Portlet API.


Could you please put some more details or code sample here. It will really help me a lot.

Thanks a lot.
Mouli Velu
Greenhorn

Joined: Oct 06, 2005
Posts: 12
Hi,
This is for passing string messages from one portlet to another.

public void messageReceived(MessageEvent event) throws PortletException {

PortletMessage message = event.getMessage();

if (message instanceof DefaultPortletMessage) {
String msgText = ((DefaultPortletMessage) message).getMessage();
event.getRequest().setAttribute("IsAnyMessage", msgText);
System.out.println("Inside MessageReceived, message = " + msgText);}
}

you can more details from the link below:
http://www-128.ibm.com/developerworks/websphere/library/techarticles/0402_konduru/0402_konduru.html
pooja jain
greenhorn
Ranch Hand

Joined: Jan 12, 2005
Posts: 213
Originally posted by rathi ji:
Can we send any object other than string to one portlet from another portlet?

Thanks.


yes. session attribute in application scope will do, if portlets are in same war.

if not, use common place (db, xml).

also look for portlet wiring from ibm.



:d
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: portlet communication - sending object not string...
 
Similar Threads
Sending an ArrayList using IBM Portlet Messaging
Portlet Communication: What is application scope, anyway?
Hiding a JBoss portlet
Redirecting or Forwarding to another Portlet with Params
portlet session?