Recommended: Sing it, brah! 5 fabulous songs for developers
JW's Top 5
Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs
The Portlet 1.0 specification has serious limitations when it comes to inter-portlet communication, but not everyone is ready to jump to Portlet 2.0. In this addition to the JavaWorld Portlet Packet, author Sandeep Tol shows you how to use the Dojo toolkit to enhance communication between portlets based on Portlet 1.0. Level: Intermediate
In the world of Java portlet programming, inter-portlet communication, also called portlet-to-portlet communication, allows multiple portlets to respond to events triggered by other portlets. For example, a product setup portlet and a product configuration portlet might communicate with each other to update data on a third portlet.
Many portal platforms allow developers to code event handlers or JMS requests to achieve this. In addition, asynchronous content rendering for specific portlets is possible using portal server features. However, these techniques require coding and configuring on the server, and are tightly coupled to specific vendor implementations. They also require a server request for very event.
The portlets described in this article have been built to the Portlet 1.0 specification. Portlet 2.0 standardizes communication among portlets, making some of the workarounds described here unnecessary. Whether you stick with Portlet 1.0 or switch to the newer spec now depends on your needs; factors include portability, compatibility with previous versions, ease of use, and performance. See these articles in the JavaWorld Portlet Packet to learn more about Portlet 2.0:
In contrast, with Ajax you can dynamically update the data displayed by a portlet without submitting an action request or refreshing the page. You can also enable client-side inter-portlet communication without relying on different server-side IPC implementations. By using the open source Dojo JavaScript toolkit, you can simplify coding, reduce lines of code, and make scripts easily to understand.
This article will help you build portlets that can dynamically update the data displayed without submitting an action request or refreshing the page, and also enable client-side inter-portlet communication without relying on different server-side IPC implementations. This article describes how to use Ajax for client-side inter-portlet communication using the Dojo JavaScript toolkit. You'll also learn how to render the data asynchronously on client side using Dojo.
This article is intended for developers who are beginning to use Ajax with Java portlets. To get the most out of this article, you should have a good understanding of JavaScript programming, the Dojo toolkit, a Java portal server, and portlet development.
Dojo is an open source JavaScript library that offers numerous scripts, widgets, and the like for dynamic Web development. Most
importantly, Dojo provides an wrapper for the XMLHttpRequest object. The sample discussed in this article uses the dojo.io.bind() function call to make an asynchronous call to dynamically update a portlet, and uses the dojo.event.topic.publish() and dojo.event.topic.subscribe() functions for inter-portlet communication.