Review: Generating the HTTP 
Response (Continued)
Most important status codes
200 (default)
302 (forwarding; set via sendRedirect)
401 (password needed)
404 (not found; set via sendError)
Most important headers you set directly
Cache Control and Pragma
Content Encoding
Content Length
WWW Authenticate
Review: Handling Cookies
Cookies involve name/value pairs sent from 
server to browser and returned when the 
same page, site, or domain is visited later
Let you
Track sessions (use higher level API)
Permit users to avoid logging in at low security sites
Customize sites for different users
Focus content or advertising
Setting cookies
Cookie constructor, set age, response.addCookie
Reading cookies
Call request.getCookies, check for null, look through 
array for matching name, use associated value



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  Business web hosting division of Vision Web Hosting Inc. All rights reserved