Getting Started

Import CS320_Jetty9.zip and CS320_Lab02.zip into Eclipse (Import → General → Existing Projects into Workspace → Archive File).

You should see two new projects in your workspace, CS320_Jetty9 and CS320_Lab02.

See AddNumbers.java, _view/addNumbers.jsp, and AddNumbersServlet.java to understand how the model, view, and servlet classes work for the AddNumbers example.

To run the AddNumbers webapp, run Main.java as a Java application and enter the following URL in your web browser:

http://localhost:8081/lab02/addNumbers

NOTE: You must work individually on this lab. It is imperative that everyone on your team be able to full comprehend, design, implement, toubleshoot, and debug the complete architecture of a standard client-server application. This WILL come up on the exam.

NOTE: If you start the server and then run AddNumbers from your browser and get a mass of Java JSP compiler errors returned from the local host, go to the Notes for Lab 2 Page for instructions on solving the problem. There are also some additional notes at the bottom of that page for other problems that you might encounter.

Your Task

Implement the GuessingGameController class so that it implements a guessing game where the user thinks of a number between 1 and 100 and the web application tries to guess it.

See GuessingGame.java, _view/guessingGame.jsp, and GuessingGameServlet.java to understand how the model, view, and servlet classes work.

To run the webapp, run Main.java as a Java application and enter the following URL in your web browser:

http://localhost:8081/lab02/guessingGame

Lastly, implement JUnit tests to test the GuessingGame and GuessingGameController classes.

Submitting

When you are done, submit the lab to the Marmoset server using the method below.

From a web browser

Save the project (CS320_Lab02) to a zip file by right-clicking it and choosing

Export…→Archive File

Upload the saved zip file to the Marmoset server as lab02. The server URL is

https://cs.ycp.edu/marmoset/