incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r610364 - /incubator/sling/whiteboard/fmeschbe/resource/osgi/console-web/src/main/java/org/apache/sling/osgi/console/web/SlingManager.java
Date Wed, 09 Jan 2008 12:19:51 GMT
Author: fmeschbe
Date: Wed Jan  9 04:19:26 2008
New Revision: 610364

URL: http://svn.apache.org/viewvc?rev=610364&view=rev
Log:
Ensure servlet configuration contains only string keys

Modified:
    incubator/sling/whiteboard/fmeschbe/resource/osgi/console-web/src/main/java/org/apache/sling/osgi/console/web/SlingManager.java

Modified: incubator/sling/whiteboard/fmeschbe/resource/osgi/console-web/src/main/java/org/apache/sling/osgi/console/web/SlingManager.java
URL: http://svn.apache.org/viewvc/incubator/sling/whiteboard/fmeschbe/resource/osgi/console-web/src/main/java/org/apache/sling/osgi/console/web/SlingManager.java?rev=610364&r1=610363&r2=610364&view=diff
==============================================================================
--- incubator/sling/whiteboard/fmeschbe/resource/osgi/console-web/src/main/java/org/apache/sling/osgi/console/web/SlingManager.java
(original)
+++ incubator/sling/whiteboard/fmeschbe/resource/osgi/console-web/src/main/java/org/apache/sling/osgi/console/web/SlingManager.java
Wed Jan  9 04:19:26 2008
@@ -19,7 +19,9 @@
 import java.io.IOException;
 import java.io.PrintWriter;
 import java.util.Dictionary;
+import java.util.Enumeration;
 import java.util.HashMap;
+import java.util.Hashtable;
 import java.util.List;
 import java.util.Map;
 import java.util.SortedMap;
@@ -299,11 +301,13 @@
             HttpContext httpContext = new SlingHttpContext(this.httpService, realm,
                 userId, password);
 
+            Dictionary<String, String> servletConfig = toStringConfig(config);
+            
             // rest of sling
-            this.httpService.registerServlet(this.webManagerRoot, this, config,
-                httpContext);
-            this.httpService.registerResources(this.webManagerRoot + "/res", "/res",
-                httpContext);
+            this.httpService.registerServlet(this.webManagerRoot, this,
+                servletConfig, httpContext);
+            this.httpService.registerResources(this.webManagerRoot + "/res",
+                "/res", httpContext);
 
         } catch (Exception e) {
             this.logService.log(LogService.LOG_ERROR, "Problem setting up", e);
@@ -373,5 +377,14 @@
         }
 
         return String.valueOf(value);
+    }
+    
+    private Dictionary<String, String> toStringConfig(Dictionary<?, ?> config)
{
+        Dictionary<String, String> stringConfig = new Hashtable<String, String>();
+        for (Enumeration<?> ke = config.keys(); ke.hasMoreElements();) {
+            Object key = ke.nextElement();
+            stringConfig.put(key.toString(), String.valueOf(config.get(key)));
+        }
+        return stringConfig;
     }
 }



Mime
View raw message