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 to...@apache.org on 2004/09/29 19:08:15 UTC
cvs commit: ws-axis/java/src/org/apache/axis/handlers/http URLMapper.java
tomj 2004/09/29 10:08:15
Modified: java/src/org/apache/axis/handlers/http URLMapper.java
Log:
Fix bug 1372 - Default servlet mapping for AxisServlet breaks service names
Patch provided by Jayachandra Sekhara Rao Sunkara
(jayachandra@gmail.com)
Don't assume there will be a leading slash in path.
Revision Changes Path
1.27 +4 -3 ws-axis/java/src/org/apache/axis/handlers/http/URLMapper.java
Index: URLMapper.java
===================================================================
RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/handlers/http/URLMapper.java,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- URLMapper.java 25 Feb 2004 14:02:40 -0000 1.26
+++ URLMapper.java 29 Sep 2004 17:08:15 -0000 1.27
@@ -41,10 +41,11 @@
/** If there's already a targetService then just return.
*/
if ( msgContext.getService() == null ) {
- // Assumes "/" + servicename
+ // path may or may not start with a "/". see http://issues.apache.org/jira/browse/AXIS-1372
String path = (String)msgContext.getProperty(HTTPConstants.MC_HTTP_SERVLETPATHINFO);
- if ((path != null) && (path.length() > 1)) {
- path = path.substring(1);
+ if ((path != null) && (path.length() >= 1)) { //rules out the cases of path="", path=null
+ if(path.startsWith("/"))
+ path = path.substring(1); //chop the extra "/"
msgContext.setTargetService( path );
}