This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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: 41060
    
  43
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 ]

Ping & DNS - my free Android networking tools app
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60752
    
  65

"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
 
Similar Threads
Cannot retrieve mapping for action
name and/or location search
Grabbing the path and arguements
query about double addition
xlink question