axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r407303 - /webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisServlet.java
Date Wed, 17 May 2006 16:14:59 GMT
Author: dims
Date: Wed May 17 09:14:58 2006
New Revision: 407303

URL: http://svn.apache.org/viewvc?rev=407303&view=rev
Log:
remove hardcoded reference to axis

Modified:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisServlet.java

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisServlet.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisServlet.java?rev=407303&r1=407302&r2=407303&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisServlet.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisServlet.java
Wed May 17 09:14:58 2006
@@ -275,7 +275,17 @@
         if (port == null) {
             port = "8080";
         }
-        return new EndpointReference("http://" + ip + ":" + port + "/axis2/services/" + serviceName);
+        String webappName = null;
+        // HACK ALERT!!! - Is there a better way to get the webapp name?
+        try{
+            String[] array =  servletConfig.getServletContext().getResource("/").toString().split("/");
+            webappName = array[array.length-1];
+        }catch(Exception e){
+        }
+        if(webappName == null) {
+            webappName = "axis2";
+        }
+        return new EndpointReference("http://" + ip + ":" + port + '/' +  webappName + "/services/"
+ serviceName);
     }
 
     protected MessageContext createMessageContext(HttpServletRequest req,



Mime
View raw message