• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

doubt regarding HttpServletResponse.addHeader method

 
yogesh srinivasan
Ranch Hand
Posts: 55
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In what ways the headers added to a response could be used ?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64181
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Most often to describe the content.
 
Ankit Garg
Sheriff
Posts: 9496
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Normally all the useful headers have a corresponding setter methods already defined in the HttpServletResponse class.
For example to set the content type you have HttpServletResponse.setContentType, for setting cookies you have HttpServletResponse.addCookie.

So normally you will not need to use HttpServletResponse.setXxxHeader() methods.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic