< Previous | Next >

Lesson 1.9: Test the Struts application

In this lesson, you will test your Struts application in aWebSphere® or Tomcat test environment.

The input and output controls previously added to the JSP are displayed in a test Web environment. To test your Struts application:

  1. In the Project Explorer, right-click input.jsp and select Run As > Run on Server. A Server Selection window opens.
  2. Select WebSphere Application Server 6.x or Apache Tomcat Server, then click Finish.
  3. If a Server Operation window opens, asking you whether you want to start the server, click Yes.
  4. Click Finish. The input.jsp file opens in a Web browser view.
    Input test fields.
  5. In the Day field, type 10.
  6. In the Month field, type 12.
  7. In the Year field, type 1962.
  8. Click Submit. The output.jsp displays with the following string:
    Day of the week output result in web browser
You can enter other dates in the fields to determine the day of the week.

Lesson checkpoint

This lesson shows you how to test your Struts application and view the output in a simulated web browser.

You learned:
  • How to select the test environment.
  • Where to insert the day, month, and year variables.
  • The output displays string format.
< Previous | Next >