Lesson 1.5: Creating two JSP files

Before you begin, you must complete Lesson 1.4: Creating an action and an action mapping.

In this Lesson, you will create two Web page files, one for input and one for output. These files will be named index.jsp and output.jsp to match the nodes you created in the Web diagram.

Creating the index.jsp file

  1. In the Web diagram, double-click the index.jsp node. The New JSP File wizard opens.
  2. In the Model field, select Struts JSP.
  3. Select the Configure advanced options check box.
  4. Click Next.
  5. On the following pages, click Next:
  6. On the Form Field Selection page in the Form bean entry menu, click dateData.
  7. Select the year, month, and day check boxes.
  8. Select the Generate fields in a form check box.
  9. Click Finish. The index.jsp file opens in the editor. It should look like this picture:

    Appearance of the index.jsp page

  10. Close the index.jsp file.

Creating the output.jsp file

  1. In the Web diagram, double-click the output.jsp node. The New JSP File wizard opens again.
  2. In the Model field, select Struts JSP.
  3. Select the Configure advanced options check box.
  4. Click Next.
  5. On the following pages, click Next:
  6. On the Form Field Selection page in the Form bean entry menu, click dateData.
  7. Select the dayOfWeek check box.
  8. Clear the Generate fields in a form check box.
  9. Click Finish. The output.jsp file opens in the editor. It should look like this picture:

    Appearance of the output.jsp page

  10. Close the output.jsp file.

All nodes of your Web diagram should now be realized, and the diagram should look like this:

An input JSP file, an output JSP file, and a dateData form bean, each connected to a Struts action mapping in the middle

Now you are ready to begin Lesson 1.6: Testing your Struts application.

Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.