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:
- Open the Web Parts drawer of the 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 new Web page name stays the same.
To rename a node, click the name to highlight it, and then type a new name.
- Type input.jsp as the new name of the Web
page node.
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.
- 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.