Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Section C.6. Structuring the Catcher portlet

C.6. Structuring the Catcher portlet

The Catcher portlet is even simpler. It doesn’t do anything except receive the event sent to it by the Pitcher portlet and then display the payload. This is a much more basic application of this particular technology than you might normally use events for. If you were doing this in a real application, you might instead examine the payload of the event and then perform some action on it. For example, a portlet could receive an event that contains a customer number. This event might have been sent by a search portlet or a portlet that lets you browse customers. After the portlet received this event, it could take that number, query a database for all orders the customer has placed, and then display those orders. In this way, a developer could write one portlet that does customer lookups and another portlet that does order lookups. If these portlets communicate with each other using events, they could be used to assemble an invoicing application fairly quickly, using the portal container to lay out the pages.

In this case, all the Catcher portlet does is display the type of pitch the Pitcher portlet generated. As you did with the Pitcher portlet, place the following method below the include() method in CatcherPortlet.java:


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial