JSF 2.0 Complete Reference, with JSF Portlet Appendix

Company Blogs February 3, 2010 By Neil Griffin Staff


JSF 2.0 Complete Reference with JSF Portlet Appendix

I'm pleased to announce the new JSF 2.0 Complete Reference book by Ed Burns and Chris Schalk, published by McGraw-Hill. During the planning stages, Ed asked me to be a contributing author and help bring the first edition of the book up-to-date with JSF 2.0, and also to write a JSF Portlet Appendix.

As listed in the Table of Contents, Appendix A discusses the following Topics:

  • Overview of Portlet 1.0 and 2.0
    • Portlet Lifecycle
    • Portlet Modes
    • Portlet Window States
    • Portlet Preferences
    • Inter-Portlet Communication
  • JSF Portlet Development
    • JSF Portlet Bridges
    • JSF Portlet View Handlers
    • JSF ExernalContext and the Portlet API
    • JSF and Portlet Preferences
    • JSF and Inter-Portlet Communication
  • ICEfaces Portlet Development
    • ICEfaces Ajax with Partial Submit
    • ICEfaces Direct-to-DOM RenderKit
    • The ice:portlet Tag
    • ICEfaces 1.x Portlet Bridge
    • ICEfaces 1.x D2DFaceletViewHandler
    • ICEfaces 1.x and Portlet Window States
    • ICEfaces Portlets and Concurrent DOM Views
    • ICEfaces 1.x Extended Request Scope
    • ICEfaces Ajax Push and Inter-Portlet Communication
    • ICEfaces Themes and Portal Themes
    • ICEfaces Themes and Liferay Themes
    • ICEfaces Ajax Bridge and Liferay Portal
    • ICEfaces Portlets and Liferay Request Attributes
  • PortletFaces
    • Downloading PortletFaces
    • PortletFacesContext
    • PortletFaces Tags
    • PortletFaces and Portlet Preferences
    • PortletFaces and Expression Language Additions
    • PortletFaces and Localization
    • Liferay Language Portlet Integration
    • Improved Integration Between Liferay and ICEfaces 1.x

This week (Feb 2nd to Feb 5th) Ed Burns & Chris Schalk will be helping to answer questions about the new book at JavaRanch. In addition, JavaRanch will be giving away a free copy of the book.

Finally I'd like to express my gratitude to Liferay, ICEsoft, Mimacom, and Triton for their generous support in making the JSF Portlet Appendix possible.

JSF 2.0 Test Drive Part 2: Developing a Website with Facelets Templating

Company Blogs October 1, 2009 By Neil Griffin Staff

As part of my work on JSR 314 (JSF 2.0) I've been reviewing the specification, Javadocs, and tag library docs for accuracy. One way I do this is to make examples that test drive what the documentation says JSF 2.0 will do.

In Part 1 of this series, I showed how to develop an Ajaxified JSF 2.0 Facelet Composite Component.

Now here's Part 2 of my JSF 2.0 Test Drive... Developing a Website with Facelets Templating

Facelets Templating

Templating -- what's that? Well templating refers to a technology that you would use to control the layout and content of a website. It's kind of like Liferay Portal's "Layout Template" feature that lets you control how portlets are arranged on the portal page.

The premiere view-handler in JSF 2.0 is Facelets, which provides a powerful templating engine designed especially for JSF. Websites typically have a layout of sections that is common for all pages: header, navigation, main content, and footer. That's where Facelets Templating comes in to save the day.

Downloadable Source Code

The Maven 2 project source code is licensed under the MPL 1.1 and is available at the edoras framework SVN repo:


Home Page Screen Shot

Here is a screen shot of the home page for the website:

The "Welcome Our Company Website" light-gray rectangle at the top is the "header" of the website. This is kind of like a banner that is to appear at the top of every web page in the site. It typically never changes.

The Home, Products, and Contact Us links are part of the "navigation" for the site. The links typically change a little from page to page in a real world site.

The "Welcome to the HOME page" dark-gray rectangle on the right is the "main" content for each page. This is the content in this part typically changes quite a bit for each page.

The "Copyright" light-gray rectangle on the bottom is the "footer" for the website. Like the header, it typically never changes.

Template Source Markup: template.xhtml

Here is the markup for the template. It's basically a Facelets f:view that specifies an h:panelGroup (renders a <div> layer) for the header, and another for the footer. Note that those sections use the Facelets ui:include tag in order to insert the contents of the header and footer info, which lives in separate XHTML files. In the middle is an h:panelGrid, which renders a two-column HTML <table>. Note the Facelets ui:insert tags -- they are kind of like markers that indicate that something will be inserted at runtime. More on that when we look at the ui:define tags in the Home page. Also, note that the Facelets ui:debug tag is specified in the template -- that's kind of a best practice for helping JSF developers debug the server-side state of things.

<f:view xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core"
  xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets"
  xsi:schemaLocation="http://www.w3.org/1999/xhtml http://www.w3.org/2002/08/xhtml/xhtml1-transitional.xsd">

  <!-- Enables CTRL+SHIFT+D for activating Facelets debug window -->
  <ui:debug />

    <ui:insert name="htmlHead" />
    <link rel="stylesheet" type="text/css" href="css/template.css" />
    <h:panelGroup layout="block" styleClass="header">
      <ui:include src="/WEB-INF/includes/header.xhtml" />
    <h:panelGrid columns="2" columnClasses="nav-col, main-col" styleClass="middle-table">
      <h:panelGroup layout="block">
          <ui:insert name="navigation" />
      <h:panelGroup layout="block">
        <ui:insert name="main" />
    <h:panelGroup layout="block" styleClass="footer">
      <ui:include src="/WEB-INF/includes/footer.xhtml" />

Home Page Source Markup: home.xhtml

Here's the markup for the home page. Note that it's not a Facelets f:view at all -- instead its a ui:composition that specifies template.xhtml as the Facelet template to be used for rendering. The main thing to point out here is that the ui:define tag "defines" the content that is to be inserted into the template via the corresponding ui:insert tag found in the template.

<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"
  xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets"
  xsi:schemaLocation="http://www.w3.org/1999/xhtml http://www.w3.org/2002/08/xhtml/xhtml1-transitional.xsd"

  <ui:define name="htmlHead">
    <meta name="description" content="Our Company Home Page" />
    <title>Our Company - Home</title>

  <ui:define name="navigation">
    <h:outputText styleClass="selected" value="Home" />
    <h:commandLink action="products" value="Products" />
    <h:commandLink action="contact-us" value="Contact Us" />

  <ui:define name="main">
    <h:outputText value="Welcome to the HOME page." />


The remainer of the files (header, footer, products page, contact-us page) are the SVN repos.

Again, hope you enjoyed seeing JSF 2.0 in action! Good stuff ahead!

JSF 2.0 Test Drive Part 1: Developing a Facelet Composite Component

Company Blogs October 1, 2009 By Neil Griffin Staff


As part of my work on JSR 314 (JSF 2.0) I've been reviewing the specification, Javadocs, and tag library docs for accuracy. One way I do this is to make examples that test drive what the documentation says JSF 2.0 will do.

To that end, here's Part 1 of my JSF 2.0 Test Drive... Developing a Facelet Composite Component

Composite Component Tag

  <testcc:inputColor />


An Ajaxified JSF 2.0 Facelet Composite Component that lets you choose an RGB color.

Downloadable Source Code

The Maven 2 project source code is licensed under the MPL 1.1 and is available at the edoras framework SVN repo:


Screen Shot


JSF 2.0 Terminology

In order to understand some of the terms used in the example, let's talk about some new JSF 2.0 Facelet terminology found in the documentation:

Composite Component: Refers to an XHTML file that contains a piece of reusable markup that is encapsulated by the ui:component tag
Composite Component Author: Refers to the person that develops the composite component
Composite Component Tag: Refers to a tag like <testcc:inputColor /> that lets folks create instances of the composite component
Using Page: Refers to the Facelet XHTML f:view that contains the composite component tag
Page Author: Refers to the person that that creates an instance of the composite component on a using page.

Composite Component Source: inputColor.xhtml

Here's the markup for the component itself. Note how JSF 2.0 now has a nice ui:interface section for defining the usage contract for the page author to abide by, and a ui:implementation section for hiding the inner workings of the component itself (the reusable markup). Also note that I didn't have to write any Javascript to perform Ajax updates in the DOM -- JSF 2.0 has that built-in with the f:ajax tag. The render attribute of f:ajax specifies a space-delimited list of "ids" that are to be re-rendered after the form is submitted via XmlHttpRequest().

<ui:component xmlns="http://www.w3.org/1999/xhtml" xmlns:c="http://java.sun.com/jsp/jstl/core"
  xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
  xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:cc="http://java.sun.com/jsf/composite"
  xsi:schemaLocation="http://www.w3.org/1999/xhtml http://www.w3.org/2002/08/xhtml/xhtml1-transitional.xsd">

    <cc:attribute name="value" required="true" type="org.edorasframework.example.Color">
      <cc:attribute name="red" required="true" />
      <cc:attribute name="green" required="true" />
      <cc:attribute name="blue" required="true" />
    <cc:actionSource name="colorPalette" targets="redSelector greenSelector blueSelector" />
    <cc:editableValueHolder name="colorFields" targets="redInputText greenInputText blueInputText" />
    <cc:facet name="header" required="true" />

    <cc:renderFacet name="header" />
    <f:ajax render="preview kids">
      <h:panelGrid columns="2">
        <h:outputLabel value="R:" />
        <h:inputText id="redInputText" value="#{cc.attrs.value.red}">
          <f:validateLongRange minimum="0" maximum="255" />
        <h:outputLabel value="G:" />
        <h:inputText id="greenInputText" value="#{cc.attrs.value.green}">
          <f:validateLongRange minimum="0" maximum="255" />
        <h:outputLabel value="B:" />
        <h:inputText id="blueInputText" value="#{cc.attrs.value.blue}">
          <f:validateLongRange minimum="0" maximum="255" />
    <h:outputText value="Color Preview: " />
    <c:set value="#{cc.attrs.value.red}" var="red" />
    <c:set value="#{cc.attrs.value.green}" var="green" />
    <c:set value="#{cc.attrs.value.blue}" var="blue" />
    <c:set value="#{red},#{green},#{blue}" var="rgb" />
    <h:outputText id="preview" value=" " style="border: 1px solid; padding: 1px 10px; background-color: rgb(#{rgb});" />
    <f:ajax render="redInputText greenInputText blueInputText preview kids">
      <h:panelGrid border="1" columns="3">
        <f:facet name="header">
          <h:outputText value="Color Palette" />
        <h:commandLink id="redSelector" value="Red">
          <f:setPropertyActionListener target="#{cc.attrs.value.red}" value="255" />
          <f:setPropertyActionListener target="#{cc.attrs.value.green}" value="0" />
          <f:setPropertyActionListener target="#{cc.attrs.value.blue}" value="0" />
        <h:commandLink id="greenSelector" value="Green">
          <f:setPropertyActionListener target="#{cc.attrs.value.red}" value="0" />
          <f:setPropertyActionListener target="#{cc.attrs.value.green}" value="255" />
          <f:setPropertyActionListener target="#{cc.attrs.value.blue}" value="0" />
        <h:commandLink id="blueSelector" value="Blue">
          <f:setPropertyActionListener target="#{cc.attrs.value.red}" value="0" />
          <f:setPropertyActionListener target="#{cc.attrs.value.green}" value="0" />
          <f:setPropertyActionListener target="#{cc.attrs.value.blue}" value="255" />
    <br />
    <h:panelGroup id="kids">
      <cc:insertChildren />


Using Page Source: usingPage.xhtml

Here's what the using page looks like, and how it creates an instance of the composite component by using a composite component tag. Note that with JSF 2.0, you can attach action-listeners and value-change-listeners to composite components. Additionally, you can specify children inside the composite component tag, provided that the composite component author uses the ui:insertChildren tag to place the children somewhere in the reusable markup. The testcc:inputColor tag shown below inserts an h:panelGrid as a child, which shows the "You Selected..." part to the user.

<f:view xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core"
  xmlns:h="http://java.sun.com/jsf/html" xmlns:testcc="http://java.sun.com/jsf/composite/testcc"
  xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.w3.org/1999/xhtml http://www.w3.org/2002/08/xhtml/xhtml1-transitional.xsd">
    <title>Using Page</title>
      <h:messages />
      <testcc:inputColor value="#{modelManagedBean.color}">

        <f:facet name="header">
          <h:outputText value="Please choose a color" />

        <f:actionListener for="colorPalette" type="org.edorasframework.example.ColorActionListener" />

        <f:valueChangeListener for="colorFields" type="org.edorasframework.example.ColorValueChangeListener" />

        The following h:panelGrid will be used by the cc:insertChildren tag in the
        cc:implementation section of the  testcc:inputColor composite component.
        <h:panelGrid columns="2">
          <f:facet name="header">
            <h:outputText value="You Selected: " />
          <h:outputLabel value="Red:" />
          <h:outputText value="#{modelManagedBean.color.red}" />
          <h:outputLabel value="Green:" />
          <h:outputText value="#{modelManagedBean.color.green}" />
          <h:outputLabel value="Blue:" />
          <h:outputText value="#{modelManagedBean.color.blue}" />

      <br />
      <h:commandButton value="Submit" />

Composite Component Value POJO: Color.java

Here is the POJO that is used to supply a value to the composite component:

package org.edorasframework.example;

import java.io.Serializable;

 * This class provides a way of representing a color as an RGB triplet.
 * @author  "Neil Griffin"
public class Color implements Serializable {

  private static final long serialVersionUID = -3810147232196826614L;

  private int red;
  private int green;
  private int blue;

  public int getBlue() {
    return blue;

  public int getGreen() {
    return green;

  public int getRed() {
    return red;

  public void setBlue(int blue) {
    this.blue = blue;

  public void setGreen(int green) {
    this.green = green;

  public void setRed(int red) {
    this.red = red;


The remainer of the files (action listener, value change listener, model managed bean) are all available from the SVN repos.

Anyways, hope you enjoyed seeing JSF 2.0 in action! Good stuff ahead!

There's Gold in that Portal!

Company Blogs October 1, 2009 By Neil Griffin Staff


On a recent trip to Colorado I had the opportunity to go panning for gold in a stream and take a tour of a gold mine. There may be a lot of gold in the West Portal (shown below), but rest assured I'm still hooked on Liferay. Although I enjoyed my time out there, it is good to be back home in Sunny, FL.


Jazoon 2009 Conference Video: Like Peanut Butter & Chocolate (or Ajax Meets Portals)

Company Blogs September 17, 2009 By Neil Griffin Staff

Here is the video recording of the Jazoon 2009 talk I was privileged to do with Micha Kiener of Mimacom:

Presentation Title: Like Peanut Butter & Chocolate (or Ajax Meets Portals)

Direct linkhttp://www.parleys.com/#id=363&st=5&sl=38

Description: Discussion of how ICEfaces and Ajax Push can be used to perform Inter-Portlet-Communication (IPC) and also provides a rich Ajax-powered user experience.

You may need to click the triangle (play) button to get the movie to play.

Conference Talks: Social Networking Portlets with ICEfaces Ajax Push

Company Blogs May 19, 2009 By Neil Griffin Staff

I have the privilege of speaking about Social Networking Portlets with ICEfaces Ajax Push at the following three conferences:

I am speaking at JSF Summit 2009

JSF Summit

Dec 1-4, 2009
Orlando, FL

I am speaking at CommunityOne 2009

CommunityOne West
Here I'll be co-speaking with Ed Burns, who is co-chairman of the JSR 314 (JSF 2.0) Expert Group

June 1-3, 2009
The Moscone Center
San Francisco

This is an open developer conference. Monday 6/1 is free!

Liferay East Coast User Conference

May 21, 2009
Rivet Logic Corporation (Training Center)
1775 Wiehle Avenue, 3rd floor
Reston, VA 20190

The talks will focus on the power and elegance of Liferay + ICEfaces Ajax Push, and how these technologies can be used together to create Social Networking portlets with Liferay Portal.

Social networking is a natural addition to portals, already a meeting place for applications. Diverse systems and users can be brought together for web-based communication and collaboration. When introduced to Ajax Push, Portlets can provide real-timecommunication features, such as presence, chat, and new forms of application-specific interaction.

Here's a screen shot of two portlets I'll be demontrating: ICEfaces Friends, and ICEfaces Chat:

The friends portlet is presence-aware, in that it has an application-scoped bean that listens to users logging-in/out of the portal. When it receives one of those events, ICEfaces Ajax Push will fire a visual effect, alerting the user of the friend's online status. If online, then the chat icon is activated. If the user clicks on the chat icon, then ICEfaces Ajax Push is used to achieve inter-portlet communication with the Chat portlet on the right. A new chat session is created, and users can chat with one another in near-real-time, again thanks to ICEfaces Ajax Push.

One of the things that I love about JSF, is the elegant, clean separation of the Model, View, and Controller concerns of the MVC design pattern. Case in point: Here's the entire XHTML markup for the Chat portlet:.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<f:view xmlns:c="http://java.sun.com/jstl/core"
    <ice:portlet styleClass="portlet-content">
        <sn:styling />
            <ice:messages />
            <c:set value="#{chatRoomsModel.roomsWithUser}" var="chatRoomsWithUser" />
            <ice:panelTabSet rendered="#{!empty chatRoomsWithUser}" value="#{chatRoomsWithUser}" var="chatRoom">
                <ice:panelTab label="#{chatRoom.name}">
                    <ice:panelGroup id="scroller" style="overflow: auto; width: 100%; height: 250px;">
                        <ice:dataTable rowClasses="results-row,results-row alt"
                                width="100%" value="#{chatRoom.chatMessages}" var="chatMessage">
                            <ice:column style="width: 50px;">
                                    portraitStyleClass="avatar" portraitWidth="30px" showJobTitle="false"
                                    showOnlineStatus="false" user="#{chatMessage.user}" />
                                <ice:outputText value="#{chatMessage.date}">
                                    <f:convertDateTime pattern="MM/dd/yyyy hh:mm:ss a" />
                                <br />
                                <ice:outputText value="#{chatMessage.text}" />
                    <ice:inputText action="#{chatRoomsBacking.addMessage(chatRoom)}" value="#{chatRoomsBacking.messageText}" />
                    <ice:commandButton action="#{chatRoomsBacking.addMessage(chatRoom)}" value="#{message['add-message']}" />


Also, these portlets make heavy use of Facelets Composite Components, and demonstrate how you can create new JSF components entirely with XHTML markup.

Hope to see you at one of these conferences!

Podcast interview by Kito Mann of JSF Central regarding Liferay and ICEfaces

Company Blogs May 6, 2009 By Neil Griffin Staff

Back in October 2008 at the JSFOne conference, I was interviewed by Kito Mann of JSF Central regarding Liferay and ICEfaces. The podcast and transcript were recently published at the JSF Central website:


Among the topics discussed are:

  • Liferay and JSF
  • Liferay and ICEfaces
  • JSR-314 JSF 2.0
  • JSR-301 JSF Portlet Bridge Standard
  • Liferay Roles and Security

Making distinctions between different kinds of JSF managed-beans

Company Blogs April 13, 2009 By Neil Griffin Staff

JSF has a simple Inversion-of-Control (IoC) container called the JSF Managed Bean Facility (MBF). Although it has a verbose XML syntax, and is not as robust as the Spring BeanFactory, PicoContainer, or the JBoss Microcontainer, the MBF does have the basics of an IoC container, and offers features like dependency injection.

When a POJO is managed by the JSF MBF, it is typically referred to as a managed-bean. But if you're going to create a maintainable JSF webapp/portlet, it is necessary to distinguish between different kinds of managed-beans. This practice will also preserve the clean separation of concerns that JSF provides by implementing the Model-View-Controller (MVC) design pattern:


Managed-Bean Type Nickname Typical Scope
Model Managed-Bean model-bean session

Description: This type of managed-bean participates in the "Model" concern of the MVC design pattern. When you see the word "model" -- think DATA. A JSF model-bean should be a POJO that follows the JavaBean design pattern with getters/setters encapsulating properties. The most common use case for a model bean is to be a database entity, or to simply represent a set of rows from the result set of a database query.

Backing Managed-Bean backing-bean request

Description: This type of managed-bean participates in the "View" concern of the MVC design pattern. The purpose of a backing-bean is to support UI logic, and has a 1::1 relationship with a JSF view, or a JSF form in a Facelet composition. Although it typically has JavaBean-style properties with associated getters/setters, these are properties of the View -- not of the underlying application data model. JSF backing-beans may also have JSF actionListener and valueChangeListener methods.

Controller Managed-Bean controller-bean request

Description: This type of managed-bean participates in the "Controller" concern of the MVC design pattern. The purpose of a controller bean is to execute some kind of business logic and return a navigation outcome to the JSF navigation-handler. JSF controller-beans typically have JSF action methods (and not actionListener methods).

Support Managed-Bean support-bean session / application

Description: This type of bean "supports" one or more views in the "View" concern of the MVC design pattern. The typical use case is supplying an ArrayList<SelectItem> to JSF h:selectOneMenu drop-down lists that appear in more than one JSF view. If the data in the dropdown lists is particular to the user, then the bean would be kept in session scope. However, if the data applies to all users (such as a dropdown lists of provinces), then the bean would be kept in application scope, so that it can be cached for all users.

Utility Managed-Bean utility-bean application

Description: This type of bean provides some type of "utility" function to one or more JSF views. A good example of this might be a FileUpload bean that can be reused in multiple web applications.


Now... One of the main benefits in making fine distinctions like this is loose coupling. What's that you ask? Well let's first take a look at an example of tight coupling, where MVC concerns can be smashed/confused into a single managed-bean:


public class ModelAndBackingAndControllerBean {

	private String fullName; // model-bean property
	private boolean privacyRendered; // backing-bean property

	// model-bean getter
	public String getFullName() {
		return fullName;
	// model-bean setter
	public void setFullName(String fullName) {
		this.fullName = fullName;

	// backing-bean getter
	public boolean isPrivacyRendered() {
		return privacyRendered;

	// backing-bean setter
	public void setPrivacyRendered(boolean privacyRendered) {
		this.privacyRendered = privacyRendered;

	// backing-bean actionListener for UI support logic
	public void togglePrivacySection(ActionEvent actionEvent) {
		privacyRendered = !privacyRendered;

	// controller-bean business logic
	public String submit() {
		System.out.println("fullName=" + fullName);
		return "success";

The problem here is that the bean would have to be kept in session scope because of the model-bean property. Additionally, what if we wanted to do some unit testing with mock model data? Can't do it. So in order to fix these problems, and to promote loose coupling, we would have three separate Java classes:

public class ModelBean {

	private String fullName;

	public void setFullName(String fullName) {
		this.fullName = fullName;

	public String getFullName() {
		return fullName;

public class BackingBean {

	private boolean privacyRendered;

	public void setPrivacyRendered(boolean privacyRendered) {
		this.privacyRendered = privacyRendered;

	public boolean isPrivacyRendered() {
		return privacyRendered;

	public void togglePrivacySection(ActionEvent actionEvent) {
		privacyRendered = !privacyRendered;


public class ControllerBean {

	private ModelBean modelBean;
	public ModelBean getModelBean() {
		return modelBean;

	public void setModelBean(ModelBean modelBean) {
		// Dependency injected from the JSF managed-bean facility
		this.modelBean = modelBean;

	public String submit() {
    	System.out.println("fullName=" + getModelBean().getFullName());
        return "success";



Now that the beans are found in different classes, they can all be kept in their appropriate scopes. The model-bean can be kept in session scope, and the backing-bean and controller-bean can be kept in request scope, thus saving memory resources on the server.

Finally, we can use the dependency injection features of the JSF MBF in order to inject the model-bean into the controller-bean. This can be seen in the following WEB-INF/faces-config.xml example, where the #{modelBean} Expression Language (EL) binding is used:

<?xml version="1.0" encoding="UTF-8"?>
<faces-config xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"



Webinar: Filthy Rich Portlets with ICEfaces and Liferay

Company Blogs September 30, 2008 By Neil Griffin Staff

UPDATE: March 17, 2011

This blog post refers to an old version of ICEfaces (1.8). I would encourage you to try out the ICEfaces 2 versions of these portlets here: http://www.portletfaces.org/portletfaces-bridge/examples

ORIGINAL POST FOLLOWS: September 30, 2008

Note: An archive of the webinar is now available on ICEfaces .org in both .wmv and quicktime:
http://www.icefaces.org/main/resources/webinars.iface (3rd item in the Archive Webinar list)

Also, here is a video+transcript of a similar presentation given at the JSFOne conference:

Webinar Title: Filthy Rich Portlets with ICEfaces and Liferay

Webinar Date/Time: Tuesday, October 14, 2008 1:00 PM - 2:00 PM EDT

Webinar Link: https://www1.gotomeeting.com/ojoin/451479046/1859554

Webinar Slides and Demo Downloads:

The sources are meant to be extracted into the "plugins" folder of the Liferay Plugins SDK. Fore more info, download the the Liferay Plugins SDK documentation.

Webinar Overview:

  • Portals and Portlets
  • Liferay Portal
  • JSF Portlets
  • ICEfaces Portlets
  • Standard Inter-Portlet Communication
  • Ajax Push Inter-Portlet Communication


Filthy Rich Portlets with ICEfaces at the JSFOne Conference!

Company Blogs August 20, 2008 By Neil Griffin Staff


Here is a video+transcript of the presentation given at the JSFOne conference:

And here is a similar webinar on ICEfaces .org in both .wmv and quicktime:
http://www.icefaces.org/main/resources/webinars.iface (3rd item in the Archive Webinar list)

The JSFOne conference is being held from Thu 9/4/2008 - Sat 9/6/2008 in the Washington, DC area. Specifically, the event is being held at the Sheraton Premier Hotel in Vienna, VA.


I have the great privilege of speaking at the conference, and will be doing a talk titled "Filthy Rich Portlets with ICEfaces and Liferay." To that end, I recently committed a new portlet to the Liferay Plugins trunk: sample-icefaces-ipc-ajax-push-portlet.

It's actually one web archive (WAR) that contains two portlets. The Customers portlet simply shows a list of customers:

When the user clicks on a customer, ICEfaces initiates an Ajax-Push event which updates the Bookings portlet with travel plans of the selected customer:

But wait! There's more -- the IPC is bi-directional in the sense that if I change the first name or last name in the Bookings portlet, then the name will be updated in the Customers portlet too, all thanks to ICEfaces Ajax Push.

See you at JSFOne!


Switched from Windows to Mac

Company Blogs August 20, 2008 By Neil Griffin Staff

Perhaps I'm dating myself, but when I entered college in 1988, the Computer Science department required me to buy a Mac II because it was the only personal computer of the day that ran a type of Unix. No, not Mac OS X silly, but A/UX. I never really used the Mac OS back then -- always did my projects under A/UX. Recently my buddy Ed Burns invited me to a "classic arcade game" exhibit at the Orlando Science center, and there happened to be an exhibit of Apple computers that was the personal collection of someone on display. You guessed it, there was a Mac II on display! Yes, that's right -- the computer I used in college was in a museum. Hey, it had an 80MB hard drive, and all my engineering friends only had 20MB drives in their IBM PCs running MS-DOS.

After I graduated, I sold my Mac II to another student. My first job had me using Windows 3.1, and I've been using Microsoft operating systems as a desktop OS ever since. I moved to Windows 95, NT4, Windows 2000, XP, and finally Vista.

I found that fresh installs of Windows XP were nice and fast. But after installing/uninstalling programs, Windows would catch a sickness that would make the OS slow down. I found that every 3-6 months I had to wipe my hard drive and reinstall XP in order to get it back to top speed. My experience with Vista was much the same. After it got slow a second time, I decided I needed a change.

I almost went with Ubuntu Linux, but I had a non-Liferay email account that required Microsoft Exchange connectivity. So I ended up going with the Mac.

Yes, after 20 years (almost to the very day), I'm driving a Mac again. How about that!


Sharing Data Between Portlets

Company Blogs August 16, 2008 By Neil Griffin Staff

If you want to share data between portlets, a common way to do that is by storing data in the user's session. Liferay Portal has some nice features for sharing session data like <shared-session-attributes> in the liferay-portlet.xml file, and shared.session.attributes in the portal-ext.properties file.

But what if you're trying to go session-less? Or what if you want to share data globally for all users across sessions?

One way to do share data like this is to store the data in the portal's ROOT context. The first step is to create a GlobalStartupAction in the Liferay EXT environment, like this:

package com.foo.liferay.startup;

public class GlobalStartupAction extends SimpleAction {

	private static List<String> fooList; 
public List<String> getFooList() {
return fooList;

public static void
@Override public void run(String[] ids) throws ActionException {
// Cache all the data
fooList = new ArrayList<String>();
fooList.add(new String("red"));
fooList.add(new String("green"));
fooList.add(new String("blue"));

Then, the GlobalStartupAction needs to be registered in the portal-ext.properties file. There is already a global startup action specified there for Liferay's own startup purposes, but thankfully this value can be a comma-delimited list, so we can just add the GlobalStartupAction after the Liferay one:


And then inside each portlet, use the magic Liferay PortalClassInvoker to call the static getFooList() method. The PortalClassInvoker utility figures out the classloader for the Liferay Portal context before calling the specified method:

import com.liferay.portal.kernel.util.PortalClassInvoker;

public class ApplicationScopeBean {

    private static final List fooList;

public ApplicationScopeBean() {
List<String> fooList = (List<String>) PortalClassInvoker.invoke("com.foo.liferay.startup.GlobalStartupAction", "getFooList"));



Improving The Performance of Liferay's Ant-Based Build System

Company Blogs November 19, 2007 By Neil Griffin Staff

In recent days, some of the engineers at Liferay reported some amazing performance gains with Liferay's Ant build system by using Linux instead of Windows. Well this peaked my curiosity to say the least. I've been working exclusively with Windows XP on my desktop since around 2001, and have only used with Linux on servers -- never for my desktop. Well I'm a former Solaris / IRIX / DecUnix / HP-UX guy and so I decided to give Linux a try on the desktop.

I tried Fedora 7 first, but received a "too many open files" error when I tried to compile Liferay Portal with the "ant all" command. I tried messing with the limits.conf file but still wasn't able to get it working.

So I tried Ubuntu and I didn't receive the "too many open files" error. Woo hoo! BTW, I've got the Nvidia XGL driver going along with the Compiz Fusion window manager. Liferay developer James Min wasn’t kidding when he wrote to me “OS X, Vista... Watch out!” COMPIZ FUSION IS TOTALLY OUT OF CONTROL WAY COOL!!! Check out this movie to see for yourself. I’ve got the desktop cube thing working between Remote Desktop to Windows and Linux. I'm loving it! (On a semi-related side note, the IntelliJ IDEA user interface has a limitation where you can only open one project at a time. With virtual desktops, I might be able to work-around this limitation by having an IntelliJ project open on each virtual desktop.)

Well back to the Ant build system performance issue... Here are my unscientific test results -- not sorted, just grouped according to hardware:

Test#MachineHard DiskOSJDKCompilerBuild Time
1Pentium M 1.8 Ghz7200RPMWindows XPSun JDK 1.4Jikes8 minutes, 30 seconds
2Pentium M 1.8 Ghz7200RPMWindows XPSun JDK 5.0Jikes3 minutes, 52 seconds
Note that by changing JDK from 1.4 to 5.0 made the build
go more than 2x faster on Windows XP
3Pentium M 1.8 Ghz7200RPM32-bit Ubuntu 7.04Sun JDK 1.4Jikes2 minutes, 54 seconds
4Pentium M 1.8 Ghz7200RPM32-bit Ubuntu 7.04Sun JDK 5.0Jikes2 minutes, 7 seconds
Note that the change from JDK 1.4 to 5.0 on Ubuntu made the build
go 1.5x faster (which is significant), but less-so than on WinXP
5Intel Core 2 Duo T7800 2.6Ghz7200RPM32-bit Windows VistaSun JDK 5.0ECJ6 minutes, 22 seconds
6Intel Core 2 Duo T7800 2.6Ghz7200RPM32-bit Windows VistaSun JDK 5.0Jikes4 minutes, 38 seconds
7Intel Core 2 Duo T7800 2.6Ghz7200RPM32-bit Windows VistaSun JDK 6.0Jikes> 11 minutes!
Note that the performance disaster here *may* have something to do with some
kind of incompatibility Java 6 and Ant. That's my best guess, anyhow.
8Intel Core 2 Duo T7600 2.4Ghz7200RPM64-bit Ubuntu 7.10Sun JDK 5.0Jikes2 minutes, 23 seconds
9Intel Core 2 Duo T7600 2.4Ghz7200RPM64-bit Ubuntu 7.10Sun JDK 5.0ECJ3 minutes, 35 seconds

Conclusions for Fastest Performance:

  • Use JDK 5.0 and not 1.4 or 6.0 due to performance problems
  • Use Linux instead of Windows
    • 32-bit Linux is somehow a little faster than 64-bit Linux. Puzzling? (compare test#4 and #8). this leads me to believe that the only remaining bottleneck is the speed of the disk -- so we have to wait for bigger solid-state drives I guess
  • Use Jikes instead of ECJ
    • Note that Jikes doesn't support some of the new language features of JDK 5.0. Liferay source is based on JDK 1.4 so compiling with Jikes should be fine until we start taking advantage of some of these new language features


BTW, Many thanks to Michael Young for showing us all how to make the ECJ compiler work with Ant to build Liferay. Copying the ejc.jar file to Ant’s “lib” folder did the trick for me. See: LEP-4273

Liferay-ICEsoft Technology Partnership

Company Blogs August 8, 2007 By Neil Griffin Staff

On 7/23/2007, Liferay and ICEsoft announced a technology partnership aimed at making the ICEfaces component suite available to JSF portlets within Liferay Portal. Work towards this goal actually began back in late 2006, when ICEsoft decided to make changes to their framework in order to support JSR-168 portlet containers. Back on 12/14/2006, ICEsoft posted a message at the ICEfaces forums titled "Liferay Portal-ICEfaces Integration" in order to test the waters and make sure there was market demand for such a feature. To date, that post has received over 37,000 views, making it one of the most viewed posts on the entire ICEsoft forum site. Needless to say, this caught the attention of the folks at ICEsoft and Liferay, and technical dialogs between our companies began.

Also back in late 2006, I started a parallel post at the Liferay discussion forums that had the same title. I was particularly interested in having the ability to use the ICEfaces component suite within Liferay. Then it happened: a user named Michael Roth (redly2001) posted a sample ICEfaces portlet for use within Liferay Portal. I downloaded his example, and was able to get it working. Nevertheless, I ran into several framework-related and component-related problems. I did my best to correct them, and sent the fixes to ICEsoft.

Since then, we at Liferay have been working closely with the software engineers at ICEsoft in order to further increase compatibility. The first fruits of these talks resulted in several Liferay/ICEfaces demos that were demonstrated in both the Liferay and ICEsoft booths at JavaOne 2007. On 7/10/2007, ICEsoft announced version 1.6 of ICEfaces with compatibility for Liferay Portal 4.3.0. Liferay is currently working with ICEsoft towards ICEfaces 1.7, which will contain additional bug fixes and compatibility with Liferay 4.3.1.

Showing 41 - 54 of 54 results.
Items 20
of 3