• Post Reply Bookmark Topic Watch Topic
  • New Topic

setHeader() and addHeader() practical example  RSS feed

 
Abhay Agarwal
Ranch Hand
Posts: 1376
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am looking for a pratical example of using setHeader() and addHeader() which can clearly mention the difference between these two.
Please provide me such example.

Thanks in advance
 
Ankit Garg
Sheriff
Posts: 9609
36
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
setHeader sets a named response header and replaces any existing headers with that name. addHeader on the other hand doesn't replace any existing headers with the same name. You can inspect response headers in Firefox using Web Developer Toolbar and using ieHttpHeaders for Internet Explorer...
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!