的下面是才達到它的最佳方法下。添加處理程序映射時使用此類而不是默認的類。
公共類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