What to do:

  • Uses state management to keep up with session attributes for the target, the minimum, the maximum and the number of guesses.
  • Uses two javabean classes - 1) the GameNumber class which we can create an instance for each of the numbers used in the game; and 2) a MessageBean that can be used to store Strings.
  • JSP view components use jsp Expression language tags rather than Java scriptlets or traditional jsp tags. No java should appear in your JSP view components.
  • The application can either start with a basic home page with a link to a servlet, or start directly with the servlet (hint: this requires that you edit the welcome file list in the web.xml file).
  • Create a map in of average guess estimates in your servlet and add it as a session attribute. The map can use the following values (the key represents the maximum of the guessing range, the value represents the estimated average guesses):

key value
10 2.5
50 5
100 6
500 8
1000 9
5000 11
10000 12

  • Create an expression language tag on the final results page that will provide a message about how the number of guesses compares to the estimated average number of guesses. For example, you might say "Your score was better than average" if the number of actual guesses is less than or equal to the estimated average value and "Needs some work, your score was higher than average." if the number of actual guesses was higher than the average.
  • ust for fun, add a tag that will print out the userAgent of the user to the bottom of the results page
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.