aspose file tools
The moose likes Servlets and the fly likes doubt regarding HttpServletResponse.addHeader method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "doubt regarding HttpServletResponse.addHeader method" Watch "doubt regarding HttpServletResponse.addHeader method" New topic

doubt regarding HttpServletResponse.addHeader method

yogesh srinivasan
Ranch Hand

Joined: Jun 08, 2007
Posts: 55
In what ways the headers added to a response could be used ?
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 61960

Most often to describe the content.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ankit Garg

Joined: Aug 03, 2008
Posts: 9326

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.

SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
I agree. Here's the link:
subject: doubt regarding HttpServletResponse.addHeader method