Lesson 1: Create a Struts enabled Web project
Use this lesson to learn how to create a dynamic Web project that is enabled for Struts.
Struts is an open-source software framework for building Java Web applications. Struts uses the model-view-controller (MVC) design pattern for application development. The MVC design pattern helps you to create and maintain complex Web applications by separating the application into three parts:
- 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 entered by the user, there is no model in this tutorial.
- The view is the interface that displays information to the user. In this tutorial, the view is composed of two Web pages that collect data from the user and display results to the user.
- The controller handles events in the application. In this tutorial, the controller is composed of an action mapping and a form bean that work together to process the information that the user enters.
To create a new Struts-based Web project:
- In the menu bar, select...
File | New | Dynamic Web Project...to open the
New Dynamic Web Project wizard.
- In the
Project name field, type DayOfWeek.
- In the Target runtime field, select the runtime that you have configured.
If you have not configured a runtime environment, click New to open the New Server Runtime Environment wizard.
For this tutorial, you can use one of the following servers:
- WAS v7.0
- WAS 6.x
- WAS 5.1 test environment or remote server
- An Apache Tomcat 5.x runtime server
This field will be disabled if a target runtime had been previously set. To enable this field, you can do one of the following:
- Specify a new EAR Project Name then select a Target Runtime.
- Select an existing EAR project from the list that uses the target runtime that you want to use.
- In the Configuration list, select Struts v1.3 Project, then click Finish.
You can see the new Struts Web project in the Enterprise Explorer.
Lesson checkpoint
You learned to create a Struts enabled Web project and select a runtime environment.