iTP Secure WebServer System Administrator's Guide (iTPWebSvr 6.0+)
Using NonStop Servlets for JavaServer Pages
(NSJSP)
iTP Secure WebServer System Administrator’s Guide—523346-002
9-36
Model-View-Controller Designs
Model-View-Controller Designs
There are two design philosophies for JSP usage. The approaches differ in terms of
where most of the processing takes place. In the first approach, shown in Figure 9-4, A
Basic NSJSP Model, the incoming request from a web browser is sent directly to the
JSP page which is responsible for processing it and replying back to the client. There
is separation of content from presentation because data access is performed using
Java beans.
This is fine for simple applications but requires all request processing to be in the JSP
page. Each page must therefore be individually responsible for managing application
state and verifying authentication and maintaining security. The second approach is to
adopt the model-view-controller design, see Figure 9-5, A Model-View-Controller
Design. In this, processing is divided between the controller and presentation
components. The presentation component, or View, are JSP pages that generate the
HTML or XML response that determines the user interface rendered by the browser.
The controller (a servlet or JSP page) is a front-end that is not concerned with
presentation, just the processing of HTTP requests. The controller instantiates beans
and other objects to be used by the presentation component.
Figure 9-4. A Basic NSJSP Model
VST904.vsd
JSP
Java Bean
or Java Servlet
REQ
RES
CLIENT
BROWSER
WEB CONT AINER
1
2
3
4
Data Storage