• Post Reply Bookmark Topic Watch Topic
  • New Topic

doubt regarding HttpServletResponse.addHeader method  RSS feed

 
yogesh srinivasan
Ranch Hand
Posts: 55
  • 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
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Most often to describe the content.
 
Ankit Garg
Sheriff
Posts: 9610
37
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!