Example based on  Professional Java for Web Applications By Nicholas S. Williams