The critical requirement for building maintainable web
applications is appropriate separation of layers of the
application. Slightly simplified, a web application typically
consists of the following layers:
a web view layer: this consists of web page templates, or some
other view technology, whose responsibility it is to supply input
data to the server application, and to present the results of
this interaction
When writing maintainable web applications, it is very important to separate the web view and presentation logic layers. This minimises the impact of changes to the view layer on the presentation logic layer, and vice versa.
This kind of separation can be enforced through the use of a model view controller (MVC) framework, of which numerous excellent open source implementations are available from the Java open source community. The best known of these is Apache Struts, although Spring also has a powerful web MVC framework. We can work with these and several others in building maintainable web applications.