You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by sl...@apache.org on 2007/12/03 15:16:50 UTC

svn commit: r600545 - in /incubator/tuscany/java/sca/modules: binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyListingAgent.java host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppServletHost.java

Author: slaws
Date: Mon Dec  3 06:16:49 2007
New Revision: 600545

URL: http://svn.apache.org/viewvc?rev=600545&view=rev
Log:
Fix web app host so that the service names include the context root when they are passed back to bindings. To work this wa we have to put a check in the listing agent to stop the test failing that looks to see if there is a path in between the context root and the service name. 

Modified:
    incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyListingAgent.java
    incubator/tuscany/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppServletHost.java

Modified: incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyListingAgent.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyListingAgent.java?rev=600545&r1=600544&r2=600545&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyListingAgent.java (original)
+++ incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyListingAgent.java Mon Dec  3 06:16:49 2007
@@ -295,7 +295,7 @@
             } else {
                 int i = filePart.indexOf(contextRoot) + contextRoot.length();
                 int j = filePart.lastIndexOf(serviceName);
-                if (i==j || (i+1 == j)) {
+                if (i>=j || (i+1 == j)) {
                     configContext.setServicePath("/");
                 } else {
                     String mapping = filePart.substring(i+1, j);

Modified: incubator/tuscany/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppServletHost.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppServletHost.java?rev=600545&r1=600544&r2=600545&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppServletHost.java (original)
+++ incubator/tuscany/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppServletHost.java Mon Dec  3 06:16:49 2007
@@ -80,6 +80,10 @@
             suri = '/' + suri;
         }
         
+        if (!suri.startsWith(contextPath)) {
+            suri = contextPath + suri;
+        } 
+                
         // In a webapp just use the given path and ignore the host and port
         // as they are fixed by the Web container
         servlets.put(suri, servlet);
@@ -95,6 +99,10 @@
         if (!suri.startsWith("/")) {
             suri = '/' + suri;
         }
+        
+        if (!suri.startsWith(contextPath)) {
+            suri = contextPath + suri;
+        }
 
         // In a webapp just use the given path and ignore the host and port
         // as they are fixed by the Web container
@@ -106,6 +114,10 @@
             suri = '/' + suri;
         }
         
+        if (!suri.startsWith(contextPath)) {
+            suri = contextPath + suri;
+        } 
+        
         // Get the servlet mapped to the given path
         Servlet servlet = servlets.get(suri);
         return servlet;
@@ -137,6 +149,11 @@
         if (!path.startsWith("/")) {
             path = '/' + path;
         }
+        
+        if (!path.startsWith(contextPath)) {
+            path = contextPath + path;
+        }
+        
         URL url;
         try {
             url = new URL(scheme, host, portNumber, path);
@@ -153,11 +170,14 @@
             suri = '/' + suri;
         }
         
+        suri = contextPath + suri;
+        
         // Get the servlet mapped to the given path
         Servlet servlet = servlets.get(suri);
         if (servlet != null) {
             return new WebAppRequestDispatcher(suri, servlet);
         }
+        
         for (Map.Entry<String, Servlet> entry : servlets.entrySet()) {
             String servletPath = entry.getKey();
             if (servletPath.endsWith("*")) {



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org