Tuesday, November 29, 2011

Portlet request lifecycle phases

In this post I've shown figures from Portlets in Action book that depict action, render and resource request lifecycle phases.

Action and render request lifecycle phases

Figure 2.6 A portlet’s request-processing phases apply to incoming requests based on the request type (action or render). The portlet’s render method is always called to ensure that the updated portlet content is displayed by the web portal.



Resource request lifecycle phase (for handling AJAX use cases)

Figure 12.1 Ajax request handling. JavaScript in the portal page sends an
asynchronous request to a servlet or portlet component, which processes the
request and returns an HTML, XML, text, or JSON response to the browser.
JavaScript in the portal page makes use of the response data to update a part
of the portlet’s content.


Saturday, November 5, 2011

What is a portlet bridge?


[The above figure is from Chapter 14 of Portlets in Action book]
A portlet bridge acts as a bridge between portlet and web application environments. It translates requests from the portlet container into something that the web application can understand, and translates response from the web application that the portlet container can understand.

Thursday, November 3, 2011

Developing JSF and Wicket Portlets

If you want to develop portlets using JSF 2.0, then you can use Portletfaces bridge: http://www.portletfaces.org/projects/portletfaces-bridge


A portlet bridge is a component that sits between the portlet environment and a web
application. It’s responsible for bridging the differences between the portlet environment
and the environment in which the web application is designed to execute.


Chapter 14 of Portlets in Action shows how you can build JSF portlets using Portletfaces bridge or Wicket portlets using WicketPortlet class. It shows how you can first create a web application and then convert it into a portlet by making a few changes to it.