如果报错
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0': Invocation of init method failed; nested exception is java.lang.IllegalStateException: Ambiguous mapping found. Cannot map 'districtController' bean method
private java.util.List<com.ts.pojo.District> com.ts.controller.DistrictController.finsDistrict()
可能是RequestMapping()中的内容重复了
如:
/**
* 根据 查询地区信息
* @return 地区信息
*/
@RequestMapping("finsDistrict")
@ResponseBody
private List<District> finsDistrict(){
List<District> list = this.districtService.finsDistrict();
return list;
}
/**
* 根据 父级id 查询地区信息
* @param pid 父级id
* @return 地区信息
*/
@RequestMapping("finsDistrict")
@ResponseBody
private List<District> finsDistrictByPid(Integer pid){
List<District> list = this.districtService.finsDistrictByPid(pid);
return list;
}