Lesson 1.1: Creating a Struts project
Struts is a framework of open-source software that can help you build Web applications quickly and easily. Struts uses the model-view-controller (MVC) design pattern of application development. The MVC design pattern makes it easier to create and maintain complex Web applications by separating the application into these three parts:
-
The View is the interface that displays information to the user. In this tutorial, the view is the two Web pages which collect data from the user and display results to the user.
-
The Controller handles the events in the application. In this tutorial, the controller is made up of an action mapping and a form bean which work together to process the information that the user enters.
-
The Model maintains the data and the business logic in the application. Since this tutorial does not use a database, and the only data is the data that the user enters, there is no model in this tutorial.
Click here for a more detailed description of the model-view-controller (MVC) design pattern.
In this Lesson, you will switch to the Web perspective and create a dynamic Web project enabled for Struts.
Switching to the Web perspective
You will use the Web perspective during this tutorial.
Follow these steps to switch to the Web perspective:
- From the menu bar, select Window > Open Perspective > Other.
- In the Select Perspective dialog, click Web.
If you don't see Web, select the Show all check box and it will appear in the list.
- Click OK.
- You may see a message asking if you want to enable the Web Development (typical) capability. If you see this message, click OK.
The workbench switches to the Web perspective.
Creating a Struts project
- From the menu bar, click File > New > Dynamic Web Project.
- On the Dynamic Web Project page, type this text as the name of the project:
DayOfWeek
- Click Next.
- On the Features page, make sure that the Struts check box is selected.
- Click Finish.
Now you are ready to begin Lesson 1.2: Editing your Web diagram.