Interportlet communication is best achieved by using event handlers, as described in How Do I: Establish Interportlet Communications with WebLogic Workshop? However, while using listenTo attribute in page flows is no longer a recommended practice for establishing interportlet communications, it is an option. This topic explains how to use multiple page flows that react to browser events such as forms.
To Create Portlets that Share Messages
NOTE: The listenTo attribute is associated with the instanceLabel of the other portlet. You can change the definitionLabel without affecting the listenTo behavior.
The first option is to use the same action method signature as in the first page flow. For example, this action definition is from the page flow controller for portlet 2:
/** * @jpf:action * @jpf:forward name="listening" path="listening.jsp" */ public Forward passString1(portlets.j1.j1Controller.Form form) { thePassedText = form.getText(); return new Forward( "listening" ); }
Or you can add a handler for ActionNotFoundException handler. For example, in the page flow controller for portlet 2, make sure the @jpf:catch annotation is defined at the class level:
/** * @jpf:controller * @jpf:catch type="ActionNotFoundException" method="doNothing" */And in the same page flow controller, that an action method such as the following is defined:
/** * @jpf:exception-handler * @jpf:forward name="current" return-to="currentPage" */ protected Forward doNothing( ActionNotFoundException e, String actionName, String message, FormData form ) { return new Forward( "current" ); }
Tutorial: Using Page Flows Inside Portlets
Portal Key Concepts and Architecture
Developing Portal Applications
Handling Exceptions in Page Flows
How Do I: Use Event Handlers to Establish Interportlet Communications?