Information Technology Reference
In-Depth Information
Controller
Web
browser
Servlet
Controller
Entity bean/
Java classes
HTTP
request
Business
objects
Session
bean
Wireless
device
Service
components
RMI
RMI/
local
inter-
face
Database
JDBC
Data access
objects
JSP
View
HTTP
response
B2B Web
Service
client
Model
View
Service-
based
architecture
Business
object
architecture
User interaction architecture
FIGURE 6.2
MVC and enterprise application architecture.
A JSP consists of Java code embedded within a structured document such
as HTML or XML. The basic idea is to use the markup language for the static
portion of the presentation and embed special tags within the page to mark
up the dynamic content. The tags are used to process incoming requests
from a client and consequently generate a response. As JSP uses additional
system resources, wherever the presentation content is static, a plain HTML
page should be used. The use of JSP allows the presentation code to be easily
maintained as regular HTML code and shields the Web developer from hav-
ing to deal with unfamiliar language and tools.
Java Scriptlets can be embedded in a JSP file, though their usage should
be kept to the minimum. Sun recommends the use of JSP where there is a
significant amount of dynamic content.
6.2.4.1.2 Servlets
Servlets are primarily used as a conduit for passing data back and forth
between a Web client and an enterprise application running on a server.
Servlets are server-side programs that execute in a servlet engine, which
often forms a part of the HTTP server, but may also run standalone as well.
Servlets run inside the servlet engine or container hosted on a Web server;
the servlet container manages the life cycle of a servlet and translates the
Search WWH ::




Custom Search