Java Reference
In-Depth Information
Linux system
Linux system
Web server
Web server
Servlet class
Servlet class
HTTP request
HTTP request
HTML
HTML
PC
PC
Web browser
Web browser
Figure 18.1 Servlet diagram
doPost(HttpServletRequest request, HttpServletResponse
response)
We hope that you've noticed the similarity between doGet() , doPost() ,
and the previously mentioned service() method. More on that in a minute.
18.3
P ERSPECTIVE
To better understand the interaction with servlets, let's consider the requests
that come to a Web server. Web servers serve up Web pages. At first (in the
early days of the Web) that just meant simple flat HTML files, along with a
few image types. A Web browser would send a request to a Web server in the
form of a URL, such as http://www.dom.com/file.html , which would be
sent to the Web server named www at the dom.com domain. It would look up
the file named file.html in its directory and send it back to the browser.
That approach worked fine, and still does today. But this only covers static
Web pages, ones whose content doesn't change. Users want to get at lots more
information today, not all of which has been embodied in static Web pages.
Search WWH ::




Custom Search