Ambiguous mapping. Cannot map 'xxxController' method
@GetMapping
public JsonResp<List<DtoLandRegion>> getLandRegionList() {
List<DtoLandRegion> regions = service.getLandRegionList();
return JsonResp.newSuccessResp(regions);
} @GetMapping
public JsonResp<List<DtoFactorType>> getFactorTypeList() {
List<DtoFactorType> factors = service.getFactorTypeList();
return JsonResp.newSuccessResp(factors);
}
上面的代码中,都有@GetMapping,并没有指定value值,所以重复了,导致映射模糊。
解决方法,指定value值。
@GetMapping("/getLandRegionList")
public JsonResp<List<DtoLandRegion>> getLandRegionList() {
List<DtoLandRegion> regions = service.getLandRegionList();
return JsonResp.newSuccessResp(regions);
}
@GetMapping("/getFactorTypeList")
public JsonResp<List<DtoFactorType>> getFactorTypeList() {
List<DtoFactorType> factors = service.getFactorTypeList();
return JsonResp.newSuccessResp(factors);
}
问题就可以解决啦!
Ambiguous mapping. Cannot map 'xxxController' method的更多相关文章
- Ambiguous mapping. Cannot map 'labelInfoController' method
使用springboot项目中,启动时出现Ambiguous mapping. Cannot map 'labelInfoController' method , 原因是,@RequestMappin ...
- Ambiguous mapping. Cannot map 'registerController' method
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappi ...
- Caused by: java.lang.IllegalStateException: Ambiguous mapping. Cannot map 'userController' method
在使用SpringMVC的时候遇到了这个问题 问题原因: 在指定方法所对应的url地址的时候重复了, 也就是@RequestMapping("url")中, 两个方法使用了同一个 ...
- Ambiguous mapping. Cannot map 'appController' method
笔者最初的一套代码模板 import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Controller; impo ...
- java.lang.IllegalStateException: Ambiguous mapping. Cannot map 'waterQuality
如果一个项目中有两个@RequestMapping("/xxx")完全相同就会报 java.lang.IllegalStateException 改进办法:修改@RequestM ...
- Java--- Ambiguous mapping. Cannot map "***Controller" been method解决办法
打开网页报错: Ambiguous mapping. Cannot map 'handController' method public com.smallchill.core.toolbox.aj ...
- SpringMVC“Ambiguous mapping found. Cannot map 'XXXController' bean method”解决方法
[转 :http://www.fanfanyu.cn/news/staticpagefile/2351.html] 最近在开发项目的过程中SpringMVC抛了个"Ambiguous map ...
- Ambiguous mapping found. Cannot map 'xxxxController' bean method
1.背景 今天要做一个demo,从github上clone一个springmvc mybatis的工程(https://github.com/komamitsu/Spring-MVC-sample-u ...
- Ambiguous mapping found. Cannot map 'competeController' bean method
报错: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMapp ...
随机推荐
- DQL:查询表中的记录
DQL:查询表中的记录 * select * from 表名; 1. 语法: select 字段列表 from 表名列表 where 条件列表 group by 分组字段 having 分组之后的条件 ...
- 三个Python自动化测试高效工具的使用总结
##Python语言的特点 Python 是一个高层次的结合了解释性.编译性.互动性和面向对象的脚本语言. Python 的设计具有很强的可读性,相比其他语言经常使用英文关键字,其他语言的一些标点符号 ...
- Python Ethical Hacking - Malware Analysis(2)
Filtering Command Output using Regex #!/usr/bin/env python import smtplib import subprocess import r ...
- 2.UDP协议
UDP只在IP数据报服务之上增加了很少功能,即复用分用和差错检测功能. 应用层给UDP多长的报文,UDP就照样发送,即一次发送一个完整报文 一.UDP首部格式 这里的长度是指(首部+数据) UDP校验 ...
- Echarts柱状图顶部加数量显示
//加在series中itemStyle: { normal: { label: { show: true, position: 'top', textStyle: { color: '#615a5a ...
- 前端css 同级元素 设置不同样式 :first-child :nth-child() 的操作收藏
说明:最近在写前端vue 调样式的时候遇到了一个问题 同一个div下对多个同级别的<span>标签进行 边距设置 <div class="shuju-div"& ...
- Python网络数据采集PDF高清完整版免费下载|百度云盘
百度云盘:Python网络数据采集PDF高清完整版免费下载 提取码:1vc5 内容简介 本书采用简洁强大的Python语言,介绍了网络数据采集,并为采集新式网络中的各种数据类型提供了全面的指导.第 ...
- fgdsafhak
- OnePill本地保存用户的结构
sharedPreferences存储的数据 int Code code 表示当前用户的类别:医生为1,用户为2. Sting user user 存储当前user的json字符串 String do ...
- C#中Session的用法详细介绍
Session模型简介 在学习之前我们会疑惑,Session是什么呢?简单来说就是服务器给客户端的一个编号.当一台WWW服务器运行时,可能有若干个用户浏览正在运正在这台服务器上的网站.当每 个用户首次 ...