Ambiguous handler methods mapped for HTTP path 'http://localhost:18080/business/DictionaryController/2': {public java.lang.String com.ztesoft.zsmart.pot.controller.business.dictionary.DictionaryController.deleteDict(java.lang.String) throws com.ztesoft.zsmart.core.exception.BaseAppException, public java.lang.String com.ztesoft.zsmart.pot.controller.business.dictionary.DictionaryController.deleteItem(java.lang.String,java.lang.String) throws com.ztesoft.zsmart.core.exception.BaseAppException}]
异常的大概意思是:模糊映射;
查看action文件,发现没有出现问题
/*
* 以下是关于页面中对于父级记录以及子级记录进行删除的操作
* 1、父级记录的删除按钮跳转
* 2、子级记录的删除按钮跳转
*/
delDict: function(dictCode, success) {
debugger;
fish.remove("DictionaryController/" + dictCode, success);
},
delItem: function(dictCode,itemCode,success) {
debugger;
fish.remove("DictionaryController/" + dictCode,itemCode,success);
debugger;
},
然后查看controller文件,发现问题所在
//库表结构左侧删除记录
@RequestMapping(value = "{dictCode}", method = RequestMethod.DELETE)
public String deleteDict(@PathVariable String dictCode) throws BaseAppException {
if (service.deleteDict(dictCode) == 1) {
return com.ztesoft.zsmart.pot.controller.web.utils.Const.SUCCESS;
}
else {
return com.ztesoft.zsmart.pot.controller.web.utils.Const.FAILED;
}
}
//子级删除操作
@RequestMapping(value = "{dictCode,itemCode}", method = RequestMethod.DELETE)
public String deleteItem(@PathVariable String dictCode,@PathVariable String itemCode) throws BaseAppException {
if (service.deleteItem(dictCode,itemCode) == 1) {
return com.ztesoft.zsmart.pot.controller.web.utils.Const.SUCCESS;
}
else {
return com.ztesoft.zsmart.pot.controller.web.utils.Const.FAILED;
}
}
因为两段代码的value值类似,电脑分不清,所以出现映射模糊的错误。