Java Reference
In-Depth Information
back to the browser. The transaction is over. No persistent connection exists be-
tween the Web server and the servlet or between the servlet and the browser.
Since a servlet is a Java program, it must run in a Java VM. The VM it runs in
is a specialized environment called a servlet engine . The role of the servlet engine is
to provide the infrastructure and framework for all the servlets that are required for
a Web site. The servlet engine loads the servlet, initializes it, invokes it, and routes
the generated response back to the Web server.
The servlet and the servlet engine are intimately integrated with the Web server.
This integration can take several forms:
1. If the Web server is written in Java, it probably has a servlet engine inte-
grated directly into it.
2. If the Web server is written in some other language, it will need to have an
extension to connect the Web server with the servlet engine. In this case,
the servlet runs outside the Web server, and the Web server communicates
with it through some protocol, usually TCP/IP. Most servlet engines sup-
ply extensions or connectors to most of the popular Web servers.
3. Some servlet engines can themselves operate as Web servers. Functionally,
this isn't different from being a Web server written in Java with an inte-
grated servlet engine. The difference is that the Web server part of the
servlet is usually not highly optimized. The servlet engine works fine as a
Web server for development, testing, and low-transaction-volume situa-
tions, but it would be better deployed in a high-transaction-volume situa-
tion as an extension to a Web server written in native platform code.
Search WWH ::




Custom Search