There are two models used in Java web application design, conveniently called Model 1 and Model 2. Model 1 is page-centric and suitable for very small applications only. Model 2 is the recommended architecture for all but the simplest Java web applications.
This chapter discusses Model 2 in minute detail and provides three Model 2 sample applications. The first example features a basic Model 2 application with a servlet as the controller. The second example is also a simple Model 2 application, however it uses a filter as the controller. The third example introduces a validator component for validating user input.
At the time of writing, an effort is being made to standardize MVC web frameworks through ...