Java Reference
In-Depth Information
1
Application Server
3.
EJB/
BEAN
2.
Servlet
(Controller)
EJB/
BEAN
1.
Web
Server
Web Client
4.
DBMS
6.
EJB/
BEAN
JSP
(View)
5.
EJB/
BEAN
F IGURE 1.1
The steps in a server-side implementation of the MVC.
These steps are as follows:
1.
The Web Client makes a request to the Web Server.
2.
The Web Server passes the request to the Controller Servlet.
3.
The servlet performs necessary manipulations to the JavaBean/EJB Model.
4.
The Controller Servlet forwards the results to the JSP View.
5.
The JSP View formats the Model for display and sends the HTML results back to the
Web Server.
6.
The Web Server then conveys the information back to the Web Client.
Some benefits of using a server-side implementation of the MVC include
A clear separation of the presentation and transaction layers, which gives you the ability
to change the look and feel of an application without recompiling.
The ability to have multiple views for multiple clients.
The ability to have a less experienced programmer develop and maintain the user inter-
face.
A quicker time-to-market by allowing the Controller programmers to focus only on
transactions, whereas the View programmers can focus primarily on presentation.
Servlets as MVC Controllers
We have chosen to use servlets as MVC Controllers after examining some of their strengths
and weaknesses.
 
Search WWH ::




Custom Search