• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Adding Header

 
alok keshri
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everybody,
Can any body help me.
Can i add a header of my choice using the response.addHeader(name,value) where name and value might be any string.
If yes how could i do it.
regards
Alok
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A response object should be available to all JSP objects - what happens when you try to addHeader( name, value );
?
Bill
 
Jignesh Malavia
Author
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by alok keshri:
Can i add a header of my choice using the response.addHeader(name,value) where name and value might be any string.
If yes how could i do it.

Do you wish to send name/value pairs to the browser for later use? See if this similar discussion helps.
-j
 
Chris Stewart
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are just trying to send values from one JSP to another, do this:

Of course if it is user specific, you would want to create a session and store values in there.
The only time I've added a header value was when I posted to a Servlet via a Java class (not a JSP). At that point you'd need to set some header information for the servlet to process. Now if you want to send information from JSP to Servlet, you can also use the setAttribute methods I posted above. I hope this rambling helps.
[ November 21, 2002: Message edited by: James Davis ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic