Lesson 1.2: Creating Web diagram nodes

In this lesson you will add nodes to your new project's Web diagram.

A Web diagram is a file that helps you visualize and change the flow of a Web application such as a Faces or Struts-based application. The following terms might help you better understand using the Web diagram editor:

To create nodes on the Web diagram that represent two Web pages and a Struts action:

  1. From the Web Parts drawer of the Palette view, drag a Web Page node onto your Web diagram. A new Web page node appears on your Web diagram with the default name page.jsp preselected.
    Tip: When you create a new node in a Web diagram, the name of that node is automatically selected so you can immediately rename the node. If you click elsewhere in the diagram before typing a new name, the new Web page name defaults to page.jsp. To rename a Web page, click the name so that it is highlighted and type the new name.
  2. Type input.jsp as the new name for the Web page.
    Note: As soon as the Web page node is named, the actual JSP this node represents is created in your Web project folder DayOfWeek>WebContent.
  3. Drag another Web page node onto the Web diagram.
  4. Type output.jsp as the name for the second Web page.
  5. Drag a Struts action onto the Web diagram. A node named action displays.
  6. Type computeDay as the name for the action, then click Enter. The Web diagram now shows an action mapping named /computeDay. In your Web project folder, navigate to DayOfWeek > Struts > <default module> > Actions to see the /computeDay action that was created.
  7. Save the Web diagram.
The Project Explorer should contain the following files:

Shows highlighted computeDay action, input.jsp, and output.jsp in the Project Explorer.

Lesson checkpoint

In this lesson, you added an input.jsp , an output.jsp, and the /computeDay action.

You learned the following:
  • How to add JSPs and a struts action to the Web diagram.
  • Where to locate these JSPs and action in the Project Explorer.