的下面是才达到它的最佳方法下。添加处理程序映射时使用此类而不是默认的类。
公共类MyHandlerMapping扩展PropertyHandlerMapping {
@Override
public XmlRpcHandler getHandler(String pHandlerName)
throws XmlRpcNoSuchHandlerException, XmlRpcException {
XmlRpcHandler result = null;
try {
result = super.getHandler("Calculator." + pHandlerName);
} catch (Exception ex) {
System.out
.println("Ignoring ALL exceptions so that default one will also get executed");
}
if (result == null) {
if ((result = super.getHandler(pHandlerName)) == null)
throw new XmlRpcNoSuchHandlerException("No such handler: "
+ pHandlerName);
}
return result;
}
}
你应该选择一个答案,如果一个是有帮助的。 – 2015-11-09 18:43:48