Create portlets and portlet projects
A portlet project, like a Web project, is a J2EE Web application. It is similar to a Web project in that a web.xml file is maintained for it. The main difference between a portlet project and a Web project is that the portlet project has an extra deployment descriptor, portlet.xml, in the WEB-INF directory.
Portlet projects
There are two types of portlet projects.
- Portlet Project: A portlet project that contains resources for portlet applications that use the IBM portlet API.
- Portlet Project (JSR 168): A portlet project that contains resources for portlet applications that use the JSR 168 portlet API. The JSR 168 portlet API is supported by WebSphere Portal 5.0.2.1 or later.
To create a portlet project, you can use the New Portlet Project wizard or New Portlet Project (JSR 168) wizard.
Portlet Type
You can select one of the following portlet types:
- Empty portlet: Creates a portlet application and a portlet entry on the portlet deployment descriptor. A skeleton portlet class is also created. To complete the portlet application, you need to update the portlet class.
- Basic portlet: Creates a portlet application that extends a portlet class: the Portlet Adapter class of the IBM portlet API, or the GenericPortlet class of the JSR 168 portlet API. This portlet type contains the portlet class, sample JSP files that are used in rendering the portlet, and a sample Java bean.
Several programming patterns are used in the portlet, including:
- Forms handling
- Storage of data items in the Portlet Session or Portlet Request
- Use of beans
- Tag library
In addition, you can optionally add the following programming patterns using the wizard:
- Action handling
- Message handling
- Storage of Portlet Data
- Cooperative portlets
- Single sign-on support
- Multiple markups
- Multiple portlet modes
- Faces portlet: Faces (JavaServer Faces) portlets are available both for the IBM portlet API and the JSR 168 portlet API. Faces portlets only support J2EE 1.3 and WebSphere Portal Version 5.x. For more information about Faces portlets, refer to JavaServer Faces portlet applications and Creating Faces portlets and projects.
- Struts portlet: Struts portlets are available only for the IBM portlet API. For more information about Struts portlets, refer to Struts portlet applications and Creating Struts portlets and projects.
Portlet Type WebSphere Portal 5.0.2.x and 5.1 JSR 168 API IBM portlet API Basic portlet Supported Supported Faces portlet Supported Supported Struts portlet Not supported Supported
Related concepts
JavaServer Faces portlet applications
Create Faces portlets and projects
Struts portlet applications
Create Struts portlets and projects
Related tasks
Create portlet projects (JSR 168)
Create Faces portlet projects
Create Struts portlet projects