This tutorial shows you how to create a simple Struts application that has two Web pages, an action mapping, and a form bean. The application contains one Web page that takes a year, month, and date as input and manipulates the data to compute the day of the week. If the input is valid, the computed value is displayed on an output Web page; if the input is not valid, an error message is displayed on the input page.
In this tutorial, you will also learn about building Web applications from Web diagrams. A Web diagram is a file that helps you visualize the application flow of a Faces-based or Struts-based Web application. This picture shows the Web diagram you will create in this tutorial:

In this figure, index.jsp represents the input JSP file, output.jsp represents the output JSP file, dateData represents the form bean that stores the input and output data, and /computeDay represents a computeDay action mapping of the action code that will be run when an input is submitted and its output is directed to output.jsp. The action code computes the day of the week for a specified date. The following table shows the input and output fields in this application:
| Field Name | File Name | Description |
|---|---|---|
| year | index.jsp | Four-digit year |
| month | index.jsp | Two-digit month |
| day | index.jsp | Two-digit day |
| dayOfWeek | output.jsp | String representing the day of the week |
To complete this tutorial, you will need approximately 1 hour. If you decide to explore other facets of Struts applications while working on the tutorial, it could take longer to finish.
When you are ready, begin Lesson 1.1: Creating a Struts project