abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eli...@apache.org
Subject svn commit: r417669 - in /incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server: ResponseContext.java exceptions/AbderaServerException.java servlet/AbderaServlet.java
Date Wed, 28 Jun 2006 05:05:16 GMT
Author: eliast
Date: Tue Jun 27 22:05:15 2006
New Revision: 417669

URL: http://svn.apache.org/viewvc?rev=417669&view=rev
Log:
- Added support for multiple values in add/setHeader methods.

Modified:
    incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/ResponseContext.java
    incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/exceptions/AbderaServerException.java
    incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/servlet/AbderaServlet.java

Modified: incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/ResponseContext.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/ResponseContext.java?rev=417669&r1=417668&r2=417669&view=diff
==============================================================================
--- incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/ResponseContext.java
(original)
+++ incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/ResponseContext.java
Tue Jun 27 22:05:15 2006
@@ -21,6 +21,7 @@
 import java.io.OutputStream;
 import java.net.URI;
 import java.util.Date;
+import java.util.List;
 import java.util.Map;
 
 import javax.activation.MimeType;
@@ -53,7 +54,7 @@
   
   public void addHeader(String name, int value);
   
-  public Map<String, String> getHeaders();
+  public Map<String, List<String>> getHeaders();
   
   public boolean hasEntity();
   

Modified: incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/exceptions/AbderaServerException.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/exceptions/AbderaServerException.java?rev=417669&r1=417668&r2=417669&view=diff
==============================================================================
--- incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/exceptions/AbderaServerException.java
(original)
+++ incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/exceptions/AbderaServerException.java
Tue Jun 27 22:05:15 2006
@@ -21,6 +21,7 @@
 import java.io.OutputStream;
 import java.net.URI;
 import java.util.Date;
+import java.util.List;
 import java.util.Map;
 
 import javax.activation.MimeType;
@@ -104,7 +105,7 @@
     
   }
   
-  public Map<String, String> getHeaders() {
+  public Map<String, List<String>> getHeaders() {
     return null;
   }
 }

Modified: incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/servlet/AbderaServlet.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/servlet/AbderaServlet.java?rev=417669&r1=417668&r2=417669&view=diff
==============================================================================
--- incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/servlet/AbderaServlet.java
(original)
+++ incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/server/servlet/AbderaServlet.java
Tue Jun 27 22:05:15 2006
@@ -18,6 +18,7 @@
 package org.apache.abdera.server.servlet;
 
 import java.io.IOException;
+import java.util.List;
 import java.util.Map;
 
 import javax.servlet.ServletException;
@@ -88,10 +89,15 @@
       // giving the developer an option to replace or set multiple
       // headers. If they want to skip the ones above, they simply
       // don't set them.
-      Map<String, String> headers = context.getHeaders();
+      Map<String, List<String>> headers = context.getHeaders();
       if(headers != null) {
         for(String header : headers.keySet()) {
-          response.setHeader(header, headers.get(header));
+          List<String> values = headers.get(header);
+          if(values == null) 
+            continue;          
+          for(String value : values) {
+            response.setHeader(header, value);
+          }
         }
       }
       



Mime
View raw message