< Previous | Next >

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:

To create nodes on your Web diagram to represent two Web pages and a Struts action:

  1. 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.
    The workbench shows the Enterprise Explorer and the Web Diagram Editor.
  2. 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.
    The first Web page node is shown with the 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 Rename.
  3. Type input.jsp as the new name of the Web page node.
    The first Web page node is shown with the name 'input.jsp'.
    Note: As soon as you name the Web page node, the JavaServer Pages (JSP) file that this node represents is created in your DayOfWeek\WebContent Web project folder.
  4. Drag another Web page node into the diagram.
  5. Type output.jsp as the name of the second Web page.
    The second Web page node is shown with the name 'output.jsp'.
  6. Drag a Struts action into the diagram to create a node called action1.
    The action node is shown with the name 'action1'.
  7. 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.
    The action node is shown with the name '/computeDay'.
  8. Save your Web diagram.
Your Web project should include the following items: /computeDay, input.jsp, and output.jsp.
The computeDay action, input.jsp, and output.jsp files in Enterprise Explorer. The Web diagram editor shows the same files in graphical form.

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.
< Previous | Next >

Feedback