Struts portlet applications
Struts-based application development can be applied to portlets, similar to the way that Struts development is implemented in Web applications. Because of the differences in the Struts and Portal technologies, the Struts Portal Framework (SPF) was developed to merge these two technologies. The SPF support in Rational Developer simplifies the process of writing Struts portlet applications and eliminates the need to manage many of the underlying requirements of portlet applications.
The following high-level list of activities are involved in developing Struts portlet applications:
- Creating a Struts portlet project.
- Designing the Struts portlet application, typically using the Web diagram editor (WDE).
- Creating and modifying artifacts that are associated with a Struts portlet application.
You will use various wizards to generate these artifacts, which include Struts portlet-specific JSP and Java files. If you use the Web diagram editor, these wizards are automatically launched when you realize the various nodes that you have placed in the editor's free-form surface. You can also use the standard menu options and drag-and-drop from available palette drawers to access the wizards to create artifacts outside the context of the editor.
- Navigating to related artifacts and viewing the project in a logical manner, using the Struts Explorer and Project Explorer.
- Running and testing the Struts portlet application.
- Setting up related preferences, if necessary.
- Validating that the project is correct.
Rational Developer provides a set of wizards that help you create Struts portlet-related artifacts. These wizards are the same wizards used to create standard Struts artifacts. Based on the development context, portlet-specific model options are provided as defaults. However, in some cases you may need to select a Model value that specifies portlet-specific file and code-generation behaviors. Please refer to the Rational Developer (standard) Struts documentation and F1 help for additional usage details. To summarize how the wizard behaviors vary (if at all) between portlet and non-portlet models, see the following list:
- Action Class wizard
- Provides support for the enhanced SPF action class, StrutsAction, which hides details that do not map well to execution in the Rational Developer environment.
- Action Mapping wizard
- Supports the SPF changes added to the Action Class wizard.
- ActionForm wizard
- No difference.
- Form-Bean Mapping wizard
- No difference.
- Struts Configuration File wizard
- Adds the required <controller> section that specifies the WpsRequestProcessor when creating the configuration file.
- Struts Module wizard
- Minor differences:
- The <init-param> entry that specifies a module is added under the WpsStrutsPortlet servlet entry instead of the ActionServlet servlet entry.
- The Welcome file list may be different.
- The Struts configuration files specified by modules include the required <controller> section that specifies the WpsRequestProcessor
- Struts Exception wizard
- No difference.
- Web Diagram wizard
- No difference.
Related concepts
Struts Portlet Framework
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 portlets
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