File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Practical Use for Header Values? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Practical Use for Header Values?" Watch "Practical Use for Header Values?" New topic

Practical Use for Header Values?

Jack Gold
Ranch Hand

Joined: Feb 04, 2005
Posts: 85
I understand the passing of parameters and how cookies are used for session management, but how are user-defined header values useful??

HFSJ Ch4 introduces the addHeader("foo", "bar") and setHeader() methods, but does not discuss their practical use!
[ August 09, 2005: Message edited by: Jack Gold ]

SCJP 1.4<br />SCJD <br />SCWCD (Studying)
Aruneesh Salhotra
Ranch Hand

Joined: May 12, 2004
Posts: 167
setHeader might be used if you need to control stuff like cache.

response.setHeader("Cache-Control","no-store"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
I agree. Here's the link:
subject: Practical Use for Header Values?
It's not a secret anymore!