The Portlet 2.0 spec has been approved!!... and Liferay is already 100% compliant with the final draft

We've been waiting for this moment for a long time. I've received this question by email, in person and through the message boards, lots of times... when will the Portlet 2.0 spec be ready?.

Finally we have the good news, I just got an email from Stefan Hepper to the JSR-286 expert group mailing list announcing that the Portlet 2.0 specification has been approved (so it's very close to be final). First of all I'd like to congratulate Stefan for all his hard work to get this spec done. I'd like to thank also the work of the rest of the expert group members, it's been a pleasure to meet them all and be able to discuss with them about the new features of the spec.

What's new in portlet 2.0?

The new spec has a lot of new features, I won't make an attempt to list them all but will highlight those that I consider to be most important:

  • Inter-portlet communication (aka IPC): there are two new mechanisms to achieve this. The first is called shared render parameters and allows portlets to set params that can be read by other portlets. This rather simple mechanism will probably be enough for all but the most complex communication needs. For those complex ones there is a second method based on events. The main advantage of this second method is that it allows a fully uncoupled communication. A portlet issues an event and doesn't have to care if there is anyone listening for it.
  • Resource serving: this is very useful not only to serve binary content such as files but also to improve drastically the support for AJAX in portlets. Through the new serveResource() method it's possible to serve HTML fragments, XML, JSON, anything that your AJAX based app can consume in the client side.
  • Portlet filters: Add filters to execute code before or after a request to a portlet. While this was already possible by using a solution provided by Apache Portals it's now part of the standard. This makes it easier to use and will fortunately foster the development of reusable filters.
  • Better compatibility with existing frameworks: Several minor improvements to ease the usage of regular web app frameworks to develop portlets.
  • Other: Easier development by using annotations, setting and reading of HTTP headers, access to the portlet window id, setting markup HEAD elements (specially useful when producing HTML, which is the most common output), etc.

And all of this while maintaining backwards binary compatibility!

Does Liferay support it? Already?

Yes! Last week Brian announced that with his last commits to subversion Liferay now passes all of the TCK tests for the final draft submitted to the JCP. Here is the image to prove it:

[Edit (March 6th): Image removed since we should not show TCK results until the final spec and TCK are publicly available (which should happen in the following days). Sorry for the inconveniences]
The next major release, 5.0 will include this support and is planned to be released in the following weeks. We'll try to get a release candidate ready ASAP for those that can't wait to test it.

Note (March 11th): I received a clarification from Stefan saying that even though the final draft is approved it's not published yet and thus it cannot be considered final. For that reason I've moderated the language to make that clear. I would expect the publication of the spec to happen in the following next days.

I want to learn more. What do I do?

There are already several introductory articles published and a quick google search will show them. But we've thought that it's not enough, so we are preparing several sample portlets to showcase the new functionalities.

Furthermore I plan to be adding a blog entry for each of the main new features as we prepare the sample portlets.

So stay tunned to Liferay's blogs.

Hi Jorge,
Great news. Any news on the availability of Liferay 5RC? We can't wait to have a first look at it!
Hi David,

Although this is not written in stone I would say there'll be an RC release before the end of the month. Meanwhile feel free to checkout the sources from trunk and build it yourself if you can't wait emoticon
Hi Jorge,

Thanks for the update, we'll be the first to give it a try.