Java Reference
In-Depth Information
FIGURE 12-19
Browsers have the ability to store, or cache, pages locally so that, if a page is
requested, it may be obtained from the client cache rather than requesting it be
sent again from the Web server. Using caching helps to improve performance by
avoiding the transmission of pages that have not changed or expired. By setting
the expired date of the page to a past date, as is done on line 87, the browser is
forced to load the page from the server rather than from cache. This ensures that
each response processed by the browser is from the server and not a cached copy
of a previous response.
The following steps enter the code to process HTTP requests in a servlet by
overriding the doGet() and doPost() methods.
To Process HTTP Requests in a Servlet
1. Enter lines 70 through 75 as shown in Figure 12-19.
TextPad displays the doGet() method for the servlet (Figure 12-20).
The doGet() method calls the doPost() method, passing the request
and response objects.
request object
doGet() method
doPost()
method call
response object
FIGURE 12-20
 
Search WWH ::




Custom Search