You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by ch...@apache.org on 2006/10/16 13:01:57 UTC

svn commit: r464444 - /webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java

Author: chinthaka
Date: Mon Oct 16 04:01:54 2006
New Revision: 464444

URL: http://svn.apache.org/viewvc?view=rev&rev=464444
Log:
Minor modification to accomodate empty string checking for context root.

Modified:
    webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java

Modified: webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java?view=diff&rev=464444&r1=464443&r2=464444
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java (original)
+++ webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java Mon Oct 16 04:01:54 2006
@@ -79,8 +79,8 @@
 
 
     protected MessageContext
-            createAndSetInitialParamsToMsgCtxt(HttpServletResponse resp,
-                                               HttpServletRequest req) throws AxisFault {
+    createAndSetInitialParamsToMsgCtxt(HttpServletResponse resp,
+                                       HttpServletRequest req) throws AxisFault {
         MessageContext msgContext = new MessageContext();
         if (axisConfiguration.isManageTransportSession()) {
             // We need to create this only if transport session is enabled.
@@ -119,14 +119,17 @@
     }
 
     /**
-     * Set the context root if it is not set already. 
-     * 
+     * Set the context root if it is not set already.
+     *
      * @param req
      */
     public void initContextRoot(HttpServletRequest req) {
 
-        if (contextRoot == null && ((contextRoot = configContext.getContextRoot()) == null)) {
-            String [] parts = JavaUtils.split(req.getContextPath(), '/');
+        if (contextRoot == null) {
+            contextRoot = configContext.getContextRoot();
+        }
+        if (contextRoot == null || "".equals(contextRoot)) {
+            String[] parts = JavaUtils.split(req.getContextPath(), '/');
             if (parts != null) {
                 for (int i = 0; i < parts.length; i++) {
                     if (parts[i].length() > 0) {
@@ -152,7 +155,7 @@
                          HttpServletResponse resp) throws ServletException, IOException {
 
         initContextRoot(req);
-        
+
         // this method is also used to serve for the listServices request.
 
         String requestURI = req.getRequestURI();
@@ -165,13 +168,15 @@
         if ((query != null) && (query.indexOf("wsdl2") >= 0 ||
                 query.indexOf("wsdl") >= 0 || query.indexOf("xsd") >= 0)) { // handling meta data exchange stuff
             agent.processListService(req, resp);
-        } else if (requestURI.endsWith(LIST_SERVICES_SUFIX) || requestURI.endsWith(LIST_FAUKT_SERVICES_SUFIX)) { // handling list services request
+        } else
+        if (requestURI.endsWith(LIST_SERVICES_SUFIX) || requestURI.endsWith(LIST_FAUKT_SERVICES_SUFIX)) { // handling list services request
             try {
                 agent.handle(req, resp);
             } catch (Exception e) {
                 throw new ServletException(e);
             }
-        } else if (!disableREST && enableRESTInAxis2MainServlet) { // if the main servlet should handle REST also
+        } else
+        if (!disableREST && enableRESTInAxis2MainServlet) { // if the main servlet should handle REST also
             MessageContext messageContext = null;
             try {
                 messageContext = createMessageContext(req, resp);
@@ -306,7 +311,7 @@
 
             axisConfiguration = configContext.getAxisConfiguration();
             config.getServletContext().setAttribute(CONFIGURATION_CONTEXT, configContext);
-            
+
             ListenerManager listenerManager = new ListenerManager();
             listenerManager.init(configContext);
             TransportInDescription transportInDescription = new TransportInDescription(
@@ -443,7 +448,7 @@
 
         if (!disableREST && !disableSeperateEndpointForREST) {
             EndpointReference restEndpoint = new EndpointReference("http://" + ip + ":" + port + '/' +
-                configContext.getRESTContextPath() + "/" + serviceName);
+                    configContext.getRESTContextPath() + "/" + serviceName);
             return new EndpointReference[]{soapEndpoint, restEndpoint};
         } else {
             return new EndpointReference[]{soapEndpoint};



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