You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by gd...@apache.org on 2001/09/07 14:44:33 UTC

cvs commit: xml-axis/java/src/org/apache/axis/handlers/http URLMapper.java

gdaniels    01/09/07 05:44:33

  Modified:    java/src/org/apache/axis/handlers/http URLMapper.java
  Log:
  Cheap fix for now - should make this work with the SimpleAxisServer,
  will try to do that later today.  The plan is to configure the SAS with
  a "root" services URL (defaulting to "services/") and then have both
  it and the AxisServlet load the MessageContext with a property
  containing the pathInfo() equivalent - i.e. the rest of the URL after
  the base, which is probably the service name.
  
  Revision  Changes    Path
  1.7       +14 -12    xml-axis/java/src/org/apache/axis/handlers/http/URLMapper.java
  
  Index: URLMapper.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/http/URLMapper.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- URLMapper.java	2001/09/05 17:23:00	1.6
  +++ URLMapper.java	2001/09/07 12:44:33	1.7
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2001 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2001 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -9,7 +9,7 @@
    * are met:
    *
    * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer. 
  + *    notice, this list of conditions and the following disclaimer.
    *
    * 2. Redistributions in binary form must reproduce the above copyright
    *    notice, this list of conditions and the following disclaimer in
  @@ -17,7 +17,7 @@
    *    distribution.
    *
    * 3. The end-user documentation included with the redistribution,
  - *    if any, must include the following acknowledgment:  
  + *    if any, must include the following acknowledgment:
    *       "This product includes software developed by the
    *        Apache Software Foundation (http://www.apache.org/)."
    *    Alternately, this acknowledgment may appear in the software itself,
  @@ -25,7 +25,7 @@
    *
    * 4. The names "Axis" and "Apache Software Foundation" must
    *    not be used to endorse or promote products derived from this
  - *    software without prior written permission. For written 
  + *    software without prior written permission. For written
    *    permission, please contact apache@apache.org.
    *
    * 5. Products derived from this software may not be called "Apache",
  @@ -64,7 +64,7 @@
   
   /** An <code>URLMapper</code> attempts to use the extra path info
    * of this request as the service name.
  - * 
  + *
    * @author Glen Daniels (gdaniels@macromedia.com)
    */
   public class URLMapper extends BasicHandler
  @@ -81,13 +81,15 @@
           if ( msgContext.getServiceHandler() == null ) {
               HttpServletRequest req = (HttpServletRequest) msgContext.getProperty(
                                                 HTTPConstants.MC_HTTP_SERVLETREQUEST);
  -            
  -            // Assumes "/" + servicename
  -            String path = req.getPathInfo();
  -            if ((path != null) && (path.length() > 1)) {
  -                path = path.substring(1);
  -    
  -                msgContext.setTargetService( path );
  +
  +            if (req != null) {
  +                // Assumes "/" + servicename
  +                String path = req.getPathInfo();
  +                if ((path != null) && (path.length() > 1)) {
  +                    path = path.substring(1);
  +
  +                    msgContext.setTargetService( path );
  +                }
               }
           }