aspose file tools*
The moose likes JSP and the fly likes Adding Header Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Adding Header" Watch "Adding Header" New topic
Author

Adding Header

alok keshri
Greenhorn

Joined: Oct 21, 2002
Posts: 2
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

Joined: Mar 22, 2000
Posts: 12781
    
    5
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

Joined: May 18, 2001
Posts: 81
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

Joined: Sep 14, 2002
Posts: 184
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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Adding Header