Java Reference
In-Depth Information
S ERVLET P ROTOCOL
A servlet is invoked as a URL, much like a static page or image file is invoked. In the
configuration between the Web server and the servlet engine, virtual mappings are
created. For example, the Web server may be configured to pass everything with the
directory name of servlet to the servlet engine. The servlet engine then maps the
name following the directory name to the actual servlet class that is to process the
request. For example, the request for http://www.mywebsite.com/servlet/Start goes
to the Web server. The Web server examines the request and sees the directory
name servlet. It knows it must pass the request to the servlet engine. The servlet en-
gine examines the request and sees the name Start after the virtual directory name.
In its configuration, for example, it knows it must pass the request to “com.my-
website.servlets.WelcomeServlet.” This path is illustrated in Figure 14.1.
FIGURE 14.1
How the browser interacts with the
Web server.
Search WWH ::




Custom Search