Use Model View Controller framework
Most web applications use a Model-View-Controller framework. In particular,
they usually use what is called the "Model 2" style, which has these components:
Controller - extends
HttpServlet, acts as the point of
entry into the application, and delegates to various worker classes to
fulfill a request. In particular, the Controller is a user of Model and
Model - data-centric classes encapsulating problem domain objects.
Each class corresponds roughly to the rows of a database table. Model
objects can be constructed from a
ResultSet of a database
query, or from HTTP request parameters.
View - implemented as Java Server Pages (or a similar tool), primarily
concerned with presentation and formatting of Model objects which have
been placed in scope by the Controller (or its delegate).
See Also :