Java Reference
In-Depth Information
Figure 8-15.
A servlet can do many things. For instance, a servlet can embed HTML into the response object. When the servlet
ends, the server will send the response object back to the browser, and the browser will display the HTML created by
the servlet. However, the servlet does not have to echo back static HTML. A servlet can perform any function a Java
class can perform. For instance, the servlet could run other Java object methods, redirect the browser to a different
Web page, or pass the request and response objects to other objects for processing. In addition, if a Post request was
passed, the servlet can retrieve and process the form information.
Figure 8-16 depicts a servlet embedding HTML into the response object and passing the response back to the
server (6). The server then sends the response back to the browser (7). The browser then retrieves the html from the
response and displays it (8).
Figure 8-16.
Search WWH ::




Custom Search