Support '*' as xmlrpcHandlerName. This will handle any XML-RPC request
that isn't handled explicitly by another application. The full XML-RPC method name will be passed through to the application, i.e. the handler name is not cut off.
This commit is contained in:
parent
284850f973
commit
8fcdf88bcf
1 changed files with 10 additions and 4 deletions
|
@ -212,6 +212,12 @@ public class ApplicationManager implements XmlRpcHandler {
|
|||
String method2 = method.substring(dot + 1);
|
||||
Application app = (Application) xmlrpcHandlers.get(handler);
|
||||
|
||||
if (app == null) {
|
||||
app = (Application) xmlrpcHandlers.get("*");
|
||||
// use the original method name, the handler is resolved within the app.
|
||||
method2 = method;
|
||||
}
|
||||
|
||||
if (app == null) {
|
||||
throw new Exception("Handler \"" + handler + "\" not found for " + method);
|
||||
}
|
||||
|
@ -269,7 +275,7 @@ public class ApplicationManager implements XmlRpcHandler {
|
|||
String pathPattern;
|
||||
String staticDir;
|
||||
String staticMountpoint;
|
||||
String[] xmlrpcHandlerNames;
|
||||
String xmlrpcHandlerName;
|
||||
String cookieDomain;
|
||||
String uploadLimit;
|
||||
String debug;
|
||||
|
@ -287,7 +293,6 @@ public class ApplicationManager implements XmlRpcHandler {
|
|||
staticDir = props.getProperty(name+".static");
|
||||
staticMountpoint = getPathPattern(props.getProperty(name+".staticMountpoint",
|
||||
joinMountpoint(mountpoint, "static")));
|
||||
xmlrpcHandlerNames = StringUtils.split(props.getProperty(name+".xmlrpcHandler"));
|
||||
cookieDomain = props.getProperty(name+".cookieDomain");
|
||||
uploadLimit = props.getProperty(name+".uploadLimit");
|
||||
debug = props.getProperty(name+".debug");
|
||||
|
@ -409,7 +414,8 @@ public class ApplicationManager implements XmlRpcHandler {
|
|||
}
|
||||
|
||||
// register as XML-RPC handler
|
||||
xmlrpcHandlers.put(app.getXmlRpcHandlerName(), app);
|
||||
xmlrpcHandlerName = app.getXmlRpcHandlerName();
|
||||
xmlrpcHandlers.put(xmlrpcHandlerName, app);
|
||||
// app.start();
|
||||
} catch (Exception x) {
|
||||
Server.getLogger().log("Couldn't bind app: " + x);
|
||||
|
@ -446,7 +452,7 @@ public class ApplicationManager implements XmlRpcHandler {
|
|||
}
|
||||
|
||||
// unregister as XML-RPC handler
|
||||
xmlrpcHandlers.remove(app.getXmlRpcHandlerName());
|
||||
xmlrpcHandlers.remove(xmlrpcHandlerName);
|
||||
} catch (Exception x) {
|
||||
Server.getLogger().log("Couldn't unbind app: " + x);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue