File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes response.addHeader()..doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "response.addHeader()..doubt" Watch "response.addHeader()..doubt" New topic


A Kumar
Ranch Hand

Joined: Jul 04, 2004
Posts: 980

I need a clarification...

If a header already exists with a particular name..and then you invoke


what happens???

David O'Meara

Joined: Mar 06, 2001
Posts: 13459

Sounds like the sort of thing covered in the API, did you check?
A Kumar
Ranch Hand

Joined: Jul 04, 2004
Posts: 980
Thank you...

From the API..

public void addHeader(java.lang.String name,
java.lang.String value)
Adds a response header with the given name and value. This method allows response headers to have multiple values.
name - the name of the header
value - the additional header value

I agree. Here's the link:
subject: response.addHeader()..doubt
It's not a secret anymore!