Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
You saw earlier in this chapter how the serveResource method of the ResourceServingPortlet lifecycle interface is used to implement Ajax use cases in portlets. In many scenarios, you’d like to perform certain tasks in the serveResource method of a portlet and trigger other portlets on the portal page to update their content. For instance, you might want to use Ajax to add a book to the catalog using the Book Catalog portlet and then communicate the ISBN of the newly added book to the Recently Added Book portlet, so that it can show the most recently added book.
In the serveResource method, a portlet can’t publish events, so it can’t communicate with other portlets when responding to an Ajax request. This leaves us with no option but to implement custom approaches to perform inter-portlet communication.