Java Reference
In-Depth Information
having the associated information displayed on the screen. In a web
scenario, users access GIS services using a standard web browser that shows
the cartographic map within an HTML page. The information is retrieved
from the remote GIS database and displayed on the same web browser. The
Java world offers two main technologies to implement web-based dynamic
access to remote data, namely Java Servlets and Java Applets.
Servlets are small programs that run on a web server handling requests
coming from HTTP clients such as a web browser. Their job is to elaborate
the incoming data, retrieve information from a database, format the result
inside an HTML document, and send the document back to the client (see
upper part of Figure 15.11). Multimedia data, such as images, can be embed-
ded in the resulting HTML document. Java Servlets are an efficient technol-
ogy to build dynamic web pages, i.e. documents whose content depends on
the specific client's request. Although it is possible, it is not recommended to
allow the servlet to retrieve the needed information from the database
directly. For security reasons it is preferable to get confidential data from an
application server using secure socket communication.
Java Applets (see Sidebar 15.1) are small programs with a graphical user
interface that run on a web browser. They reside on the file system of the
web server as byte code files. When a remote HTTP client connects to a web
page embedding a reference to an applet, the applet's code is uploaded and
executed inside the client's browser. The applet is not allowed to access the
local resources on the client side (e.g. its file system), but it communicates
Application
server
Web browser
Web server
JDBC
DB
HTTP
HTML page
Data images
Sockets
Servlet
Application
server
Web browser
Web server
HTTP
JDBC
DB
Sockets
Applet
Figure 15.11 Web-based distributed systems that use servlet (upper) or applet (lower) technology
 
Search WWH ::




Custom Search