You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlrpc-dev@ws.apache.org by dl...@apache.org on 2001/12/13 02:39:02 UTC
cvs commit: xml-rpc/src/java/org/apache/xmlrpc XmlRpcServer.java
dlr 01/12/12 17:39:02
Modified: src/java/org/apache/xmlrpc XmlRpcServer.java
Log:
James E Jurach Jr. <mu...@erf.net> says about his patch:
In XmlRpcServer.java, we find indexOf(".") of methodName to separate the
handlerName from the method name. This both assumes the handlerName does
not have dots (which may or may not be correct according to the spec...),
but further allows dots to appear in the method name (which is almost
certainly NOT correct, given our mapping of methodName to java method
name). By chanding that indexOf() to lastIndexOf(), we can better map
handlerName to a package, and methodName to a method name.
I say:
Reading the "Payload format" section of the spec
<http://xmlrpc.org/spec>, I don't see any reason why the handler name
couldn't contain dots. Josh Lucas concurs. The spec says:
"The <methodCall> must contain a <methodName> sub-item, a string,
containing the name of the method to be called. The string may only
contain identifier characters, upper and lower-case A-Z, the numeric
characters, 0-9, underscore, dot, colon and slash. It's entirely up to
the server to decide how to interpret the characters in a methodName."
In XmlRpcServer, we choose to interpret the everything after the last
dot as the methodName, and everything before it as the handlerName.
Revision Changes Path
1.3 +1 -1 xml-rpc/src/java/org/apache/xmlrpc/XmlRpcServer.java
Index: XmlRpcServer.java
===================================================================
RCS file: /home/cvs/xml-rpc/src/java/org/apache/xmlrpc/XmlRpcServer.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -u -r1.2 -r1.3
--- XmlRpcServer.java 2001/09/04 22:03:49 1.2
+++ XmlRpcServer.java 2001/12/13 01:39:02 1.3
@@ -182,7 +182,7 @@
Object handler = null;
String handlerName = null;
- int dot = methodName.indexOf (".");
+ int dot = methodName.lastIndexOf (".");
if (dot > -1)
{
handlerName = methodName.substring (0, dot);