Tools for Struts development
The Struts feature provides tools that help you use Struts to develop Web applications more effectively.
The Struts framework helps you create Web applications that are more maintainable. With the Struts tools in this product, you can create Struts-based Web applications more efficiently.
Note: To use the Struts tools, select them when you install this product.
The following sections discuss the tools that you can use for Struts application development:
Benefits of Struts tools Struts editors Editors enhanced for Struts development Struts drawers in the Palette Web diagram editor
Benefits of Struts tools
The Struts feature provides the following benefits:
- Lets you set up a Struts project automatically so that the Struts classes (JAR files), and other Struts-related resources are located properly
- Provides wizards to create form beans, Struts actions, and other Struts resources, thus simplifying the creation process and eliminating the need to update the configuration file manually
- Includes a specialized editor that understands the syntax of the Struts configuration file
- Validates the configuration, checking configuration files and JSP references to Struts objects (defined in the configuration file) when a JSP file is saved and built
- Provides Struts support for editing, including the addition of Struts tags to the Palette view or the Web diagram editor palette
- Contributes to the Page Data view for the Page Designer, to help you create forms and displays for your form beans.
- Shows a list of Struts resources in the Enterprise Explorer and can be used with the Web diagram editor.
- Renders Struts tags within Page Designer
- Uses a Web diagram editor to design application flow, which has the following benefits:
- Enables you to design a dynamic Web application visually
- Efficiently documents an application and helps communicate its structure and flow
- Provides quick access to resource-appropriate editors and wizards
- Enables you to separate design from development
- Helps you visualize existing applications
Struts editors
The Struts tools in the Struts feature provide the following editors:
Table 1. Editors for Struts development Editor Description Struts configuration file editor Supports specialized editing of Struts configuration files. Web diagram editor Shows the overall structure of the Struts application, allows navigation to the editors for the underlying resources, and lets you edit some aspects of those resources directly.
Editors enhanced for Struts development
In addition, the following editors have been enhanced:
Table 2. Editors enhanced for Struts development Editor Description Page Designer Visually represents Struts tags, which you can drag and drop in the editor. XML editor Uses the configuration file DTD when you edit a Struts configuration file.
Struts drawers in the Palette
Struts tags are available in the following drawers in the Palette:
Table 3. Struts drawers Header Header Struts HTML tags These tags are used to create Struts input forms, as well as other tags generally useful in the creation of HTML-based user interfaces. Struts bean tags These JSP custom tags are useful in defining new beans (in any desired scope) from a variety of possible sources, as well as a tag to render a particular bean (or bean property) to the output response. Struts logic tags These tags are useful in managing conditional generation of output text, looping over object collections for repetitive generation of output text, and application flow management. Struts nested tags These tags and supporting classes extend the base Struts tags to let them nest inside each other. When these tags nest, the fundamental logic of the original tags does not change, except that all references to beans and bean properties are managed in a nested context. Struts template tags These tags provide a full-featured, robust framework for assembling presentation pages from component parts.
Remember: As of Struts 1.1 the template tag library is deprecated. Use the tiles tag library instead.
Struts tiles tags These tags provide a full-featured, robust framework for assembling presentation pages from component parts.
Web diagram editor
A Struts module is a Struts configuration file and a set of corresponding actions, form beans, and Web pages. A module is defined in the Web deployment descriptor to help separate and define the parts of a Struts application.
When you create a Web diagram, you can associate it with a Struts module. After the association is made, it is permanent.
In a Web diagram, Struts resources and links are represented by nodes and connections. To edit a resource or a link:
- To open the editor for a resource, double-click the node for that resource. For example, if you double-click a node that represents an action mapping:
- If the action mapping refers to an Action class, the Java™ editor opens the class and puts focus on the execute(...) method.
- If the action mapping does not refer to an Action class, the configuration file editor opens with focus on the action mapping.
- To open the editor for a link, double-click the source of the connection for the link.
- If the connection represents a forward from an action mapping, the editor for a Struts configuration file opens and puts focus on the forward.
- If the connection represents a link from a Web page, the default editor for the file opens and places the cursor on the link definition.
Related tasks
Developing Struts applications