The Stipend Calculator

An organization pays low-income retirees an auxiliary stipend of up to $1500/month depending on their age, number of years of service, and annual income.

The stipend calculator estimates the amount of this stipend according to a complex formula.

Here's the form that must be filled out:

The information on this form is submitted to a as an HTTP request to a stipend calculator servlet.

Here is the servlet's response:

If any of the inputs are negative, the servlet throws an exception that is caught by the servlet container and a standard error page is displayed:

Implementation

Here are the instructions for implementing the stipend calculator:

Implementation

Filters

Next we demonstrate how to enhance this web application by adding filters to a chain in front of the calculator servlet.

Filters