Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 66681 invoked from network); 25 Sep 2007 19:57:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Sep 2007 19:57:29 -0000 Received: (qmail 12980 invoked by uid 500); 25 Sep 2007 19:57:19 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 12939 invoked by uid 500); 25 Sep 2007 19:57:19 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 12928 invoked by uid 99); 25 Sep 2007 19:57:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Sep 2007 12:57:19 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Sep 2007 19:57:28 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 4CC951A9832; Tue, 25 Sep 2007 12:57:08 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: scm@geronimo.apache.org From: vamsic007@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20070925195708.4CC951A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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; } }