Wednesday, May 9, 2007

What's New in the Java Portlet Specification 2.0 (JSR 286)

At a high-level, the Java Portlet 2.0 specification provides additional coordination capabilities between portlets. Version 1.0 provided the programming model for standalone portlets. In version 2.0, events from one portlet can be called from another portlet. The portlet wiring can be done at runtime through a configuration file.

Having not coded portlets, some of the coding details in this session covering how portlet inter-communication is performed was not absorbed. However, demonstrations were run using Apache Pluto, which is worth downloading and experimenting with to obtain a better understanding.

Version 2.0 provides different caching options: FULL, Portlet, Page. Ajax usage in portals is also feasible. The portlet is responsible for importing the library files and handles the Ajax calls. Ajax functionality is restricted due to no state changes.

Portlets in V2.0 can now set cookies and http headers. Although this is new from V 1.0, some restrictions do apply. One portlet can "accidentally" overwrite another portlet's cookie.

Portlets now support filters and request/response wrappers are available. See javax.portlet.filter.

Therefore, in summary, Portlet V2.0 now supports Ajax, moves from a stand-alone model to a coordinated model, and provides better integration among portlets.

1 comment:

SkiDiver said...

Good information. Thanks for blogging. It is great to hear what is going on out there.