You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by va...@apache.org on 2007/09/25 21:57:07 UTC

svn commit: r579359 - in /geronimo/plugins/tuscany/trunk: geronimo-tuscany-http-jetty/src/main/java/org/apache/geronimo/tuscany/http/jetty/ geronimo-tuscany-http-tomcat/src/main/java/org/apache/geronimo/tuscany/http/tomcat/

Author: vamsic007
Date: Tue Sep 25 12:57:07 2007
New Revision: 579359

URL: http://svn.apache.org/viewvc?rev=579359&view=rev
Log:
Allow only "/tuscany" as the context-path for webservice URLs.

Modified:
    geronimo/plugins/tuscany/trunk/geronimo-tuscany-http-jetty/src/main/java/org/apache/geronimo/tuscany/http/jetty/GeronimoServletHost.java
    geronimo/plugins/tuscany/trunk/geronimo-tuscany-http-tomcat/src/main/java/org/apache/geronimo/tuscany/http/tomcat/GeronimoServletHost.java

Modified: geronimo/plugins/tuscany/trunk/geronimo-tuscany-http-jetty/src/main/java/org/apache/geronimo/tuscany/http/jetty/GeronimoServletHost.java
URL: http://svn.apache.org/viewvc/geronimo/plugins/tuscany/trunk/geronimo-tuscany-http-jetty/src/main/java/org/apache/geronimo/tuscany/http/jetty/GeronimoServletHost.java?rev=579359&r1=579358&r2=579359&view=diff
==============================================================================
--- geronimo/plugins/tuscany/trunk/geronimo-tuscany-http-jetty/src/main/java/org/apache/geronimo/tuscany/http/jetty/GeronimoServletHost.java (original)
+++ geronimo/plugins/tuscany/trunk/geronimo-tuscany-http-jetty/src/main/java/org/apache/geronimo/tuscany/http/jetty/GeronimoServletHost.java Tue Sep 25 12:57:07 2007
@@ -77,6 +77,7 @@
     private static final Log log = LogFactory.getLog(GeronimoServletHost.class);
 
     private static final int DEFAULT_PORT = 8080;
+    private static final String CONTEXT_PATH = "/tuscany";
     private NetworkConnector[] connectors;
     private JettyContainer container = null;
     private Kernel kernel = null;
@@ -162,6 +163,9 @@
                     + "'.  Do you have a connector configured for that port?");
         }
         String path = uri.getPath();
+        if(!path.startsWith(CONTEXT_PATH)) {
+            throw new IllegalArgumentException("Invalid URI "+uri+" for webservice binding.  Context path should be "+CONTEXT_PATH+" instead of "+uri.getPath());
+        }
         path = (path.startsWith(SEPARATOR)) ? path.substring(1) : path;
         String contextPath = SEPARATOR + (path.indexOf(SEPARATOR) != -1 ? path.substring(0,path.indexOf(SEPARATOR)) : path);
         String mapping = path.indexOf(SEPARATOR) != -1 ? path.substring(path.indexOf(SEPARATOR)) : SEPARATOR;
@@ -340,6 +344,6 @@
     }
     
     public String getContextPath() {
-    	return "/tuscany";
+        return CONTEXT_PATH;
     }
 }

Modified: geronimo/plugins/tuscany/trunk/geronimo-tuscany-http-tomcat/src/main/java/org/apache/geronimo/tuscany/http/tomcat/GeronimoServletHost.java
URL: http://svn.apache.org/viewvc/geronimo/plugins/tuscany/trunk/geronimo-tuscany-http-tomcat/src/main/java/org/apache/geronimo/tuscany/http/tomcat/GeronimoServletHost.java?rev=579359&r1=579358&r2=579359&view=diff
==============================================================================
--- geronimo/plugins/tuscany/trunk/geronimo-tuscany-http-tomcat/src/main/java/org/apache/geronimo/tuscany/http/tomcat/GeronimoServletHost.java (original)
+++ geronimo/plugins/tuscany/trunk/geronimo-tuscany-http-tomcat/src/main/java/org/apache/geronimo/tuscany/http/tomcat/GeronimoServletHost.java Tue Sep 25 12:57:07 2007
@@ -61,6 +61,7 @@
 
     private static final Log log = LogFactory.getLog(GeronimoServletHost.class);
     private static final int DEFAULT_PORT = 8080;
+    private static final String CONTEXT_PATH = "/tuscany";
     private Engine engine;
     private NetworkConnector[] connectors;
     private Container host;
@@ -115,6 +116,9 @@
             throw new IllegalArgumentException("Invalid port '" + port + "'.  Do you have a connector configured for that port?");
         }
         String path = uri.getPath();
+        if(!path.startsWith(CONTEXT_PATH)) {
+            throw new IllegalArgumentException("Invalid URI "+uri+" for webservice binding.  Context path should be "+CONTEXT_PATH+" instead of "+uri.getPath());
+        }
         path = (path.startsWith(SEPARATOR))?path.substring(1):path;
         String contextPath = SEPARATOR + (path.indexOf(SEPARATOR) != -1 ? path.substring(0,path.indexOf(SEPARATOR)) : path);
         String mapping = path.indexOf(SEPARATOR) != -1 ? path.substring(path.indexOf(SEPARATOR)) : SEPARATOR;
@@ -219,6 +223,6 @@
     }
     
     public String getContextPath() {
-    	return "/tuscany";
+        return CONTEXT_PATH;
     }
 }