Specifying the portlet.xml File for Your JSF Portlet

Each portlet project must have a WEB-INF/portlet.xml deployment descriptor file. When creating a JSF portlet using Liferay IDE or the Plugins SDK, this file is created for you. JSF portlets require a couple deployment descriptors.

First, using JSF 2.x in a portlet requires specifying javax.portlet.faces.GenericFacesPortlet as the portlet’s class. You specify this class name in the portlet’s <portlet-class> entity. Notice that the portlet in the following portlet.xml snippet meets this requirement:

        <display-name>JSF Portlet</display-name>



Second, each portlet must map a facelet to each portlet mode that it supports. The portlet.xml file content above supports the VIEW, EDIT, and HELP portlet modes, and maps each of those modes to a specific facelet.

In the example code above, VIEW mode support is specified by the <portlet-mode>view</portlet-mode> element. The VIEW mode is mapped to the /view.xhtml facelet by the <init-param> element:


You can set up your portlet.xml file similarly. Next, you’ll start using portlet preferences.

Using Portlet Preferences with JSF

Liferay Faces Alloy UI Components

Liferay Faces Bridge UI Components

Understanding Liferay Faces Bridge

« Understanding the Liferay Faces Version SchemeUsing Portlet Preferences with JSF »
Was this article helpful?
0 out of 0 found this helpful