CIT 597 Assignment 7: Ajax Calculator Servlet
Fall 2008, David Matuszek
Write a web application that functions as a simple hand calculator, but also keeps a "paper trail" of all your previous work--just as in the previous assignment. Your calculator can even look the same (or change it, if you prefer).
This time, though, use Ajax.
You need a servlet to get the request, call a model class to do the work, and return the result. This is the controller.
You can, if you wish, use the Java Session Tracking API to keep track of
the "paper trail" and the current value. If you are feeling
adventurous, you can instead keep this information in the
XMLHttpRequest object.
Write a model class to handle the computations. Oh wait, you've already got one.
This page contains the calculator GUI, along with the "paper trail." For details on what it should look like, refer to the previous assignment.
Use Ajax in this HTML page to (1) send the request and (2) update the page with the response.
Use ajax-calculator.do as the
name seen by the user. Do not use
calculator.do as the name of this calculator, and do
not remove or rename the previous calculator! We are behind in
grading, and you don't want the Assignment 6 calculator to vanish
before we get to it.
Not as stupid as the last one! At least this calculator will be faster.
(Although, with the client and server on the same computer, instead of
communicating over a slow connection, you probably won't see the difference.
Trust me
, it's faster.)
This assignment will be due by midnight, Wednesday November 5. Zip your
complete
webapps directory and submit it via
Blackboard.