Adding nodes to Web diagrams
You can add a node to a diagram to represent a resource such as a Web page, a Web application, a JavaServer Faces (JSF) action, or a Struts action. When you add a node to a Web diagram, the underlying resources are typically created automatically.
- Create a Web project. You can create either a dynamic Web project or a static Web project.
- Create a dynamic Web project if your Web application contains dynamic J2EE resources such as servlets, JSP files, filters, and associated metadata. A dynamic Web application can contain multiple Web diagrams.
- Create a static Web project if your Web application does not contain any server side scripting. A static Web project contains resources that do not change at runtime on the Web server, for example HTML and CSS files.
When you create a Web project, a Web Diagram,
WebDiagram.gph, is automatically created and opened in the editor. You can begin to define the flow of your Web application.
- Create a Web diagram.
There are several types of node that you can add to a Web diagram:
- Web Page
- A JSP or an HTML page. The Web page must be defined within the same Web application as the Web diagram being edited.
- Web Project
- A dynamic Web project with optional JSF or Struts support
- Faces Action
- A JSF action.
- Struts Action
- An action mapping defined within a Struts configuration file. This file must be defined within the same Web application as the Web diagram being edited.
- Struts Action in Other Module
- A Struts module and the intended entry point for that module.
- Struts 'Global' Node
- A node that is used to create connections with global scope.
To add a node to a Web diagram:
- Drag a node from the palette or the Enterprise Explorer, and drop it onto the diagram. The name of the node is highlighted for editing.
- Create the associated resource in one of several ways:
- If you want to create the associated resource automatically now, press Enter. A realized node is shown in the diagram.
- If you want to select or create the associated resource manually now, click the
button. A selection dialog box opens. In the dialog box, select an existing resource from the list or click the button to create a new resource. (The button name depends on the type of node that you are creating.) Then click OK. A realized node is shown in the diagram.
- If you want to create the associated resource later, press Shift+Enter. An unrealized node is shown in the diagram. For more information about creating the associated resource, refer to Realizing nodes.
A node might contain one or more sections or compartments, depending on the type of node. For example, a Web page node contains compartments named Links and Data. You can expand or collapse the Data compartment by clicking the small triangle inside the right edge of the compartment.
After you have added two or more nodes to the Web diagram, you can proceed with creating connections or realizing the nodes.
Note: When you create a diagram within a Struts 1.1 Web project, you associate the diagram with a Struts module. You can only add action mappings that belong to the Struts module associated with the diagram that you are editing. If you add other mappings, a module node is created with an entry action mapping set to the action mapping that you tried to create. You can, however, add a Web page or a Web application that belongs to the same enterprise archive (EAR) as the one with which the diagram is associated.
For more information about adding nodes to a Web diagram, see the related topics:
Related concepts