Lesson 2: Create Web diagram nodes
Use this lesson to learn how to add nodes to the Web diagram of your new project.
A Web diagram helps you visualize and change the flow of a Web application. Before using the Web diagram editor, you should understand the following terms:
- A node represents a resource, such as a Web page, a Java bean, a Struts action, or a Web application.
- A connection represents the logic flow between two of these resources.
To create nodes on your Web diagram to represent two Web pages and a Struts action:
- In Enterprise Explorer, expand your Web project and double-click Web Diagram to open your Web diagram in the editor.
Tip: Select the Welcome to the Web Diagram Editor object on the Web diagram, and then press the Delete key to remove the object.
- Open the Web Parts drawer of the Palette
Window | Show View | Palette
Drag a Web page node onto your diagram. The diagram shows a new Web page node with the default name page.jsp.
Tip: When you create a new node in a Web diagram, the name of the node is automatically selected for editing. If you click elsewhere in the diagram before typing a new name, the node becomes realized and the new Web page name stays the same. When you realize a node, the underlying resource is created. To rename a realized node, right-click the node and select
- Type input.jsp as the new name of the Web page node.
Note: As soon as you name the Web page node, the JSP file that this node represents is created in your DayOfWeek\WebContent Web project folder.
- Drag another Web page node into the diagram.
- Type output.jsp as the name of the second Web page.
- Drag a Struts action into the diagram to create a node called action1.
- Type computeDay as the name of the action and press Enter.
The Web diagram displays an action node named /computeDay. The action is created in DayOfWeek\Struts\<default module>\Actions.
- Save your Web diagram.
Your Web project should include the following items: /computeDay, input.jsp, and output.jsp.
Lesson checkpoint
In this lesson, you added an input JSP file, an output JSP file, and the /computeDay action.
You learned to do these tasks:
- Add JSP files and a Struts action to your Web diagram.
- Locate your JSP files and Struts action in the Enterprise Explorer.