< Previous | Next >

Lesson 9: Test a Struts application

Test your Struts application in an IBM® WebSphere® or Apache Tomcat runtime environment. You should be able to see the input and output controls that you previously added to the JSP pages in this environment.

To test your Struts application:

  1. In the Enterprise Explorer, right-click the input.jsp file and select Run As > Run on Server.
  2. In the Server Selection window, select the server runtime that you configured for the Web project and click Finish. The input JSP page opens in a Web browser view.
    A Web browser view shows the input JSP page with three fields and two buttons.
  3. In the JSP page, type the following data in the fields:
    1. In the Day field, type 10.
    2. In the Month field, type 12.
    3. In the Year field, type 1962.
  4. Click the Submit button. The output JSP page is displayed in the Web browser view. The value in the DayOfWeek field should display Wednesday.
    The Web browser view displays the name and value of the DayOfWeek field.
You can enter other dates in the fields of the input JSP to compute the corresponding days of the week.

Lesson checkpoint

Congratulations! You successfully tested your Struts application and viewed the output in a simulated Web browser.
You learned to do these tasks:
  • Select a test environment.
  • Type data into the fields of an input JSP page.
  • Display results in an output JSP page in a string format.
< Previous | Next >

Feedback