Creating Faces portlets
In order to create a Faces portlet, associate it with an existing portlet project. You can add multiple Faces portlets to a Faces portlet project. In many cases it will not be necessary to explicitly create a Faces portlet, because when you create a Faces portlet project using the New Portlet Project wizard, a Faces portlet is created by default.
Typically, you will use this wizard to create additional Faces portlets to an existing Faces portlet project.
- Select File > New > Portlet from the menu bar.
- Assign the new portlet to the appropriate project using the Project drop-down list. This field will default to the active project in your workspace.
- Click the Faces portlet radio button.
- Optionally, click the Next. If you prefer not to configure additional options, click Finish to create the portlet.
- Supply the appropriate settings in the Portlet Settings page. Click Next.
- In the Miscellaneous page, specify any additional modes that you want to enable for the portlet.
Check the Create portlet subclass check box to create a subclass of com.ibm.faces.webapp.WPFacesGenericPortlet (or com.ibm.faces.webapp.FacesGenericPortlet if the portlet uses the JSR 168 API), using the common class and package name prefixes previously defined in the wizard, and insert method stubs that call the super implementation. You can customize the portlet class as you choose.
View mode is initially selected by default, but can be deselected. For each mode that is selected (including View) you can specify an Initial page other than the default, which is built using the project name. The Initial page field takes a path specification, relative to the Web Content folder (for example, if you type /folder/subfolder/TestView.jsp, TestView.jsp would be created in /WebContent/folder/subfolder. Folders that do not currently exist will be created. The leading "/" is optional.
From the Model drop-down list, you can select either Portlet, for a standard Faces portlet JSP file, or Portlet with client-side data caching to add the Faces Client Framework feature to the project, along with the appropriate taglib directive in the JSP file.
The specified initial JSP files are created and the corresponding <config-param> (for an IBM portlet) or <init-param> (for a JSR 168 portlet) values are automatically generated in portlet.xml when you complete the wizard. To add additional modes after you create the portlet, the configuration parameters must be specified using the Portlet Deployment Descriptor editor.- Click Finish. The new portlet is created with a Faces portlet definition in web.xml and portlet.xml. Note that the J2EE level and WebSphere Portal version of this portlet is determined by the settings that you defined for the portlet project.
Related concepts
Creating Faces portlets and projects
Faces portlet communication
Related tasks
Creating Faces portlet projects
Adding and updating Faces portlet modes for existing IBM portlets
Adding and updating Faces portlet modes for existing JSR 168 portlets
Creating Faces portlet JSP files
Creating Faces applications - overview