Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

addHeader(String, String) vs. setHeader(String, String)

 
Dumitru Husleag
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the diference between the two methods of the HttpServletResponse ?
 
Sathya Sankar
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dumitru,
addHeader(String header, String value) : If a header with the specified name already exists, the value given in this method will be added to the list of values the header already has. If the header specified does not exist, it is created with the specified value.
setHeader(String header, String value) : If a header with the specified name already exists, it's existing value(s) are cleared out and the new value is saved. If the header specified does not exist, it is created with the specified value.
Ciao,
GSS
 
Dumitru Husleag
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Sankar
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic