7.4. DefaultPortletMessage

This object implements the PortletMessage interface and provides the basic functionality needed for sending string messages between portlets on the same page regardless of the portlet application.

Note

Since portlet messaging can be accomplished across portlets in different applications, this is the recommended way to implement portlet messaging.

If you broadcast a DefaultPortletMessage to null, it will be sent to all portlets on the page implementing the MessageListener interface. Example 7-2 illustrates sending a simple broadcast message to all portlets on the same page regardless of application affiliation.

Example 7-2. Broadcasting a message to all portlets on a page
PortletMessage msg = new DefaultPortletMessage("Some ...

Get IBM Rational Application Developer V6 Portlet Application Development and Portal Tools now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.