File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Http request and response headers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Http request and response headers" Watch "Http request and response headers" New topic
Author

Http request and response headers

devayani Devasthali
Ranch Hand

Joined: Aug 25, 2005
Posts: 40
Hello,
I have tried request.getHeader() method along with getHeaderNames().
with HeaderNames() got many results as - accept, referer etc.
still didnt get the exact meaning and use of them
where shall I get the exact info abt the same?
can u pls help me in foinding it out?
thanx in advance
regards
devayani
Arun Boraiah
Ranch Hand

Joined: Nov 28, 2001
Posts: 233
Hi,
Generally header information is for the browsers to intimate the required behavior of the page being displayed.
Example if you don�t wish to cache the page, you can set this in the header of the page like this.

response.setHeader("Pragma", "No-cache");
response.setHeader("Cache-Control", "no-cache");
response.setDateHeader("Expires", 1);

Which is equlivent of adding this html tags in the static html page.

<meta HTTP-EQUIV="Pragma" content="no-cache">
<meta HTTP-EQUIV="Expires" content="-1">

Like this there are many more header information that can be set. Details can be found in some good HTML books or even Goggle can help you�.

Regards
Arun


Sharing is learning
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42913
    
  68
For a comprehensive treatment, read RFC 2616 - HTTP/1.1:

headers in general

request headers

response headers
[ February 16, 2006: Message edited by: Ulf Dittmer ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61761
    
  67

"devayani Dev", you have already been asked on at least one previous occasion to adjust your display name to meet JavaRanch standards. This is not optional. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it prior to your next post.

Be aware that accounts with invalid display names are removed.

bear
JavaRanch Sheriff


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Http request and response headers