Creating Struts portlets

To create a Struts portlet, associate it with an existing portlet project. Currently, you can only include one Struts portlet per portlet project. In many cases it will not be necessary to explicitly create a Struts portlet, because you can add a Struts portlet when you create a Struts portlet project using the New Portlet Project wizard.

For a portlet project that does not already contain a Struts portlet, follow these steps to add a Struts portlet to that project:

  1. In the Web perspective, select File > New > Portlet. The New Portlet wizard opens.

  2. Select the target portlet project from the Project list box. This field will default to the active project in your workspace. Because the portlet is created within the context of a specific project, any portlet that you create will inherit the API-type and code model capabilities associated with the project.

  3. Click the Struts portlet radio button.

  4. Optionally, click Next to further define the portlet. If you prefer not to configure additional options, click Finish to create the portlet.

  5. To create a portlet that uses the JSP Standard Tag Library tags, select the JSP Standard Tag Library from the Web Project features list. For more information about how WebSphere Portal supports the use of tags from the JSP Standard Tag Library (JSTL), refer to "Using JSTL tags in the portal JSPs" in the WebSphere Portal Information Center.

  6. Supply the appropriate settings in the Portlet Settings page. Click Next.

  7. Update any Struts portlet-specific settings in the Struts Portlet Settings page.

  8. In the Miscellaneous page, specify any additional markups and modes that you want to enable for the portlet in the project.

    1. Struts portlets always support html markup. You can add Compact HTML (chtml) or WML 1.3 (wml) markup support to the project. These markups are not currently supported by Rational Developer, but you can manually add the related tag libraries to use the tags available for the specified markups.

    2. Select the appropriate check boxes for any additional modes that you want to enable for the portlet. View mode is always provided by default.

  9. Click Finish. The new portlet is created with a Struts portlet definition in web.xml and portlet.xml. The J2EE level and WebSphere Portal version of this portlet is the same level that is associated with WebSphere Portal v5.1. This version will work with WebSphere Portal v5.0 and v4.x.

 

Related concepts

Struts portlet applications
Creating Struts portlets and projects
Struts-based Web applications - overview
Struts tools for application development
Web diagrams and the Web diagram editor

 

Related tasks

Creating Struts portlet projects
Creating Struts portlet JSP files
Creating well-architected Web applications using Struts
Creating Web diagrams for new applications

Related reference
Differences between Struts 1.1 and SPF tag library classes