Common HTTP 1.1 Request 
Headers (Continued)
Connection 
In HTTP 1.0, keep alive means browser can handle 
persistent connection. In HTTP 1.1, persistent connection 
is default. Persistent connections mean that the server can 
reuse the same socket over again for requests very close 
together from the same client
Servlets can t do this unilaterally; the best they can do is 
to give the server enough info to permit persistent 
connections. So, they should set Content Length with 
setContentLength (using ByteArrayOutputStream to 
determine length of output). See example in Core Servlets 
and JavaServer Pages.
Cookie
Gives cookies previously sent to client. Use getCookies, 
not getHeader. (See later slides)
41
Servlets
www.corewebprogramming.com
Common HTTP 1.1 Request 
Headers (Continued)
Host
Indicates host given in original URL 
This is a required header in HTTP 1.1. This fact is 
important to know if you write a custom HTTP client 
(e.g., WebClient used in book) or telnet to a server and 
use the HTTP/1.1 version
If Modified Since
Indicates client wants page only if it has been changed 
after specified date
Don't handle this situation directly; implement 
getLastModified instead. See example in Core Servlets 
and JavaServer Pages Chapter 2
42
Servlets
www.corewebprogramming.com
21




  

Home

About Services Network Support FAQ Order Contact
 

Servlet Web Hosting

Our partners:Jsp Web Hosting Unlimited Web Hosting Cheapest Web Hosting  Java Web Hosting Web Templates Best Web Templates PHP Mysql Web Hosting Interland Web Hosting Cheap Web Hosting PHP Web Hosting Tomcat Web Hosting Quality Web Hosting Best Web Hosting  Mac Web Hosting 

Lunarwebhost.net  Business web hosting division of Vision Web Hosting Inc. All rights reserved