File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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
JavaRanch » Java Forums » Java » Servlets
Bookmark "doubt regarding HttpServletResponse.addHeader method" Watch "doubt regarding HttpServletResponse.addHeader method" New topic
Author

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
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

Most often to describe the content.


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

Joined: Aug 03, 2008
Posts: 9291
    
  17

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: http://aspose.com/file-tools
 
subject: doubt regarding HttpServletResponse.addHeader method