• Post Reply Bookmark Topic Watch Topic
  • New Topic

setHeader()  RSS feed

 
Bharadwaj Adepu
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how can i use the setHeader() method. can any one please tell me the implementation of this method.

i have a JSP page in which it says


here it says getHeader("UNAME") this means that somewhere it is set as setHeader("UNAME","value"); where is it done?
I have to do this as i have to set my username here.
Can anyone please help.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66263
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As a header? Why would you be using headers for this?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To answer your question, you would have to do it on the client.

Headers, for the most part should be treated as a lower level construct for the browser and the server to pass HTTP information back and forth, not for the application to use.

Are you writing a custom client or is your client a browser?
 
Bharadwaj Adepu
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To answer your question, you would have to do it on the client.

How do we do this on the client? Can you please explain.

Are you writing a custom client or is your client a browser?

Yes, am trying to write a custom client.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then it depends a bit on how you connect to the server. If you use URLConnection or one of its subclasses then you set request headers like so:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!