• Post Reply Bookmark Topic Watch Topic
  • New Topic

addheader and addcookie

 
jamil lusa
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[color=darkred]i know setheader will replace the previous header value, how about addheader? how does it handle mutliple same name string added? for example:


what happens if i getHeader('abc')? there is no any clue from API.


thank in advanced![/color]
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Posts: 2781
174
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

what happens if i getHeader('abc')? there is no any clue from API.

There actually is an explanation:

javax.servlet.http Interface HttpServletResponse getHeader

java.lang.String getHeader(java.lang.String name)

Gets the value of the response header with the given name.
If a response header with the given name exists and contains multiple values, the value that was added first will be returned.


Regards,
Frits
 
jamil lusa
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks, i thought getHeader is from HttpServletRequest API xD. that is why i cannot find the info.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!