Common HTTP 1.1 Response 
Headers
Cache Control (1.1) and Pragma (1.0) 
A no cache value prevents browsers from caching page. 
Send both headers or check HTTP version
Content Encoding 
The way document is encoded. Browser reverses this 
encoding before handling document. See compression 
example earlier.
Content Length
The number of bytes in the response
See setContentLength on previous slide 
Use ByteArrayOutputStream to buffer document  so you 
can determine size. 
See detailed example in Core Servlets and 
JavaServer Pages
61
Servlets
www.corewebprogramming.com
Common HTTP 1.1 Response 
Headers (Continued)
Content Type
The MIME type of the document being returned.
Use setContentType to set this header
Expires
The time at which document should be considered out of 
date and thus should no longer be cached
Use setDateHeader to set this header
Last Modified
The time document was last changed. 
Don't set this header explicitly; provide a 
getLastModified method instead. 
See example in Core Servlets and JavaServer Pages
Chapter 2
62
Servlets
www.corewebprogramming.com
31




  

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