File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes setHeader() and addHeader() practical example Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "setHeader() and addHeader() practical example" Watch "setHeader() and addHeader() practical example" New topic
Author

setHeader() and addHeader() practical example

Abhay Agarwal
Ranch Hand

Joined: Feb 29, 2008
Posts: 1101
    
    1

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


Oracle Java Web Service Developer (1z0-897), Oracle certified Java 7 Programmer, SCJA 1.0, SCJP 5.0, SCWCD 5.0, Oracle SQL Fundamentals I
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9302
    
  17

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...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: setHeader() and addHeader() practical example