This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
What is your opinion on using AJAX events vs JSR 286 Events for Inter-Portlet Communication.
On a related topic.... does making requests to the serveResource method refresh the session? Because I remember that JSR 168 didn't have an AJAX proxy and instead I've used a servlet... which doesn't refresh the session... so even though the user is clicking away, at some point the session will expire if they don't make a full request back to the server.
Inter-portlet communication using AJAX can get quite messy sometimes. Event-based inter-portlet communication is quite sophisticated, giving you the opportunity to send Java objects to the portlet(s) registered to receive the event. The benefit of using event-based IPC is that the receiver portlet can perform an operation in response to the received event. For instance, chapter 11 shows an example scenario in which there are 2 portlets - Book Catalog and Recently Added Book. When a user enters a new book to the catalog, an event is generated for which Recently Added Book portlet has registered interest. The event payload contains the Book object, representing the newly added book. The Recently Added Book portlet extracts Book object from the event and makes use of it update its content. Also, its easy to add new receiver portlets to your portal without modifying the event-sender portlet.
The ResourceServingPortlet interface is part of Portlet 2.0 API; therefore, you don't need to worry about session sync issues or timeouts.