geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r496033 - in /geronimo/server/trunk/modules: geronimo-axis/src/test/java/org/apache/geronimo/axis/ geronimo-axis2/src/main/java/org/apache/geronimo/axis2/ geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/ geronimo-tomcat6/src/main/j...
Date Sun, 14 Jan 2007 05:57:48 GMT
Author: dims
Date: Sat Jan 13 21:57:45 2007
New Revision: 496033

URL: http://svn.apache.org/viewvc?view=rev&rev=496033
Log:
figure out what the name of the war is and set the configuration context root

Modified:
    geronimo/server/trunk/modules/geronimo-axis/src/test/java/org/apache/geronimo/axis/AxisRequest.java
    geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java
    geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyEJBWebServiceContext.java
    geronimo/server/trunk/modules/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/TomcatEJBWebServiceContext.java
    geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/WebServiceContainer.java
    geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/WebServiceContainerInvoker.java

Modified: geronimo/server/trunk/modules/geronimo-axis/src/test/java/org/apache/geronimo/axis/AxisRequest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis/src/test/java/org/apache/geronimo/axis/AxisRequest.java?view=diff&rev=496033&r1=496032&r2=496033
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis/src/test/java/org/apache/geronimo/axis/AxisRequest.java
(original)
+++ geronimo/server/trunk/modules/geronimo-axis/src/test/java/org/apache/geronimo/axis/AxisRequest.java
Sat Jan 13 21:57:45 2007
@@ -97,6 +97,10 @@
     }
 
     public String getRemoteAddr() {
+        return remoteAddress;
+    }
 
+    public String getContextPath() {
+        return "/axis2/";
     }
 }

Modified: geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java?view=diff&rev=496033&r1=496032&r2=496033
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java
(original)
+++ geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java
Sat Jan 13 21:57:45 2007
@@ -35,6 +35,7 @@
 import org.apache.axis2.transport.http.server.HttpUtils;
 import org.apache.axis2.transport.OutTransportInfo;
 import org.apache.axis2.util.UUIDGenerator;
+import org.apache.axis2.util.JavaUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.webservices.WebServiceContainer;
@@ -58,6 +59,7 @@
     private final String endpointClassName;
     private final PortInfo portInfo;
     ConfigurationContext configurationContext = ConfigurationContextFactory.createEmptyConfigurationContext();
+    private String contextRoot = null;
 
     public Axis2WebServiceContainer(PortInfo portInfo, String endpointClassName, ClassLoader
classLoader) {
         this.classLoader = classLoader;
@@ -81,6 +83,8 @@
 
     protected void doService(final Request request, final Response response)
             throws Exception {
+        initContextRoot(request);
+
         if (LOG.isDebugEnabled()) {
             LOG.debug("Target URI: " + request.getURI());
         }
@@ -151,6 +155,24 @@
             }
         }
 
+    }
+
+    private void initContextRoot(Request request) {
+        if (contextRoot == null || "".equals(contextRoot)) {
+            String[] parts = JavaUtils.split(request.getContextPath(), '/');
+            if (parts != null) {
+                for (int i = 0; i < parts.length; i++) {
+                    if (parts[i].length() > 0) {
+                        contextRoot = parts[i];
+                        break;
+                    }
+                }
+            }
+            if (contextRoot == null || request.getContextPath().equals("/")) {
+                contextRoot = "/";
+            }
+            configurationContext.setContextRoot(contextRoot);
+        }
     }
 
     public void doService2(

Modified: geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyEJBWebServiceContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyEJBWebServiceContext.java?view=diff&rev=496033&r1=496032&r2=496033
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyEJBWebServiceContext.java
(original)
+++ geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyEJBWebServiceContext.java
Sat Jan 13 21:57:45 2007
@@ -263,6 +263,10 @@
             return request.getRemoteAddr();
         }
 
+        public String getContextPath() {
+            return request.getContextPath();
+        }
+
         private static final Map methods = new HashMap();
 
         static {

Modified: geronimo/server/trunk/modules/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/TomcatEJBWebServiceContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/TomcatEJBWebServiceContext.java?view=diff&rev=496033&r1=496032&r2=496033
==============================================================================
--- geronimo/server/trunk/modules/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/TomcatEJBWebServiceContext.java
(original)
+++ geronimo/server/trunk/modules/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/TomcatEJBWebServiceContext.java
Sat Jan 13 21:57:45 2007
@@ -231,6 +231,10 @@
             return request.getRemoteAddr();
         }
 
+        public String getContextPath() {
+            return request.getContextPath();
+        }
+
         private static final Map methods = new HashMap();
 
         static {

Modified: geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/WebServiceContainer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/WebServiceContainer.java?view=diff&rev=496033&r1=496032&r2=496033
==============================================================================
--- geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/WebServiceContainer.java
(original)
+++ geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/WebServiceContainer.java
Sat Jan 13 21:57:45 2007
@@ -114,6 +114,8 @@
         void setAttribute(String name, Object value);
 
         java.lang.String getRemoteAddr();
+
+        java.lang.String getContextPath();
     }
 
     public interface Response {

Modified: geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/WebServiceContainerInvoker.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/WebServiceContainerInvoker.java?view=diff&rev=496033&r1=496032&r2=496033
==============================================================================
--- geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/WebServiceContainerInvoker.java
(original)
+++ geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/WebServiceContainerInvoker.java
Sat Jan 13 21:57:45 2007
@@ -120,6 +120,10 @@
             return request.getContentType();
         }
 
+        public String getContextPath() {
+            return request.getContextPath();
+        }
+
         public InputStream getInputStream() throws IOException {
             return request.getInputStream();
         }



Mime
View raw message