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:
- A node is an icon that represents a resource such as a Web page, Java™ bean,
or Web application.
- A connection is a line that connects two nodes.
To create nodes on the Web diagram that represent two Web pages and
a Struts action:
- 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.
- 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.
- Drag another Web page node onto the Web
diagram.
- Type output.jsp as the name for the second
Web page.
- Drag a Struts action onto the Web diagram.
A node named action displays.
- 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 to
see the /computeDay action that was created.
- Save the Web diagram.
The Project Explorer should contain the following files:
