geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdam...@apache.org
Subject svn commit: r596561 - /geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/Deployer.java
Date Tue, 20 Nov 2007 07:49:23 GMT
Author: gdamour
Date: Mon Nov 19 23:49:23 2007
New Revision: 596561

URL: http://svn.apache.org/viewvc?rev=596561&view=rev
Log:
If contextPath is prefixed by '/' then we strip it otherwise 
the generated URL is wrong as we get two '/',
e.g http://host:port//contextpath/upload, which obviously does not work

Modified:
    geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/Deployer.java

Modified: geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/Deployer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/Deployer.java?rev=596561&r1=596560&r2=596561&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/Deployer.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/Deployer.java
Mon Nov 19 23:49:23 2007
@@ -180,7 +180,13 @@
                 return null;
             }
             AbstractName module = (AbstractName) names.iterator().next();
-            return remoteDeployAddress + "/" + kernel.getAttribute(module, "contextPath")
+ "/upload";
+            String contextPath = (String) kernel.getAttribute(module, "contextPath");
+            if (null == contextPath) {
+                throw new IllegalStateException("Cannot find contextPath attribute for ["
+ module + "]");
+            } else if (contextPath.startsWith("/")) {
+                contextPath = contextPath.substring(1);
+            }
+            return remoteDeployAddress + "/" + contextPath + "/upload";
         } catch (Exception e) {
             log.error("Unable to look up remote deploy upload URL", e);
             return null;



Mime
View raw message