geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vamsic...@apache.org
Subject 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/
Date Tue, 25 Sep 2007 19:57:07 GMT
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;
     }
 }



Mime
View raw message