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 ...
随机推荐
- 从JDK源码理解java引用
目录 java中的引用 引用队列 虚引用.弱引用.软引用的实现 ReferenceHandler线程 引用队列的实现 总结 参考资料 java中的引用 JDK 1.2之后,把对象的引用分为了四种类型, ...
- PHP实现多继承
题问php是否支持多继承? 答案:不可以,只支持单继承. 如何实现多继承呢? 答案:可以使用 interface 或 trait 实现 . interface这里我们就不做过多的说明了,它的原理就是一 ...
- Mysql数据库搭建集群---实现主从复制,读写分离
参考博客:https://blog.csdn.net/xlgen157387/article/details/51331244 A. 准备:多台服务器,且都可以互相随意访问root用户,都可以随意进 ...
- 【Nginx】如何格式化日志并推送到远程服务器?看完原来很简单!!
写在前面 Nginx作为最常用的反向代理和负载均衡服务器,被广泛的应用在众多互联网项目的前置服务中,很多互联网项目直接将Nginx服务器作为整个项目的流量入口.这就使得我们可以通过对Nginx服务器日 ...
- 3.OSPF协议及链路状态算法
OSPF的特点: 1.使用洪泛法向自治系统内所有路由器发送信息,即路由器通过输出端口向所有相邻的路由器发送信息,而每一个相邻路由器又再次将此信息发往其所有的相邻路由器.最终整个区域内所有路由器都得到了 ...
- Logging with ElasticSearch, Kibana, ASP.NET Core and Docker
好久不见,前两周经历了人生第一次"伪牛市",基金和股市大起大落,更加坚信"你永远赚不到超出你认知范围之外的钱,除非靠着运气",老韭菜诚不欺我也. 当能力与野心不 ...
- git安装并与远程仓库关联相关配置
git是当前最流行的版本控制系统,下面简单记录一下git的安装及其与远程仓库的关联. git安装 打开git官网,下载对应的安装包. 双击运行安装包,安装过程中可以直接选择默认配置,一路next下去. ...
- 理解Linux的硬链接与软链接-转载
理解Linux的硬链接与软链接 来自:https://www.ibm.com/developerworks/cn/linux/l-cn-hardandsymb-links/index.html
- 想理解JVM看了这篇文章,就知道了!(一)
前言 本章节属于Java进阶系列,前面关于设计模式讲解完了,有兴趣的童鞋可以翻看之前的博文,后面会讲解JVM的优化,整个系列会完整的讲解整个java体系与生态相关的中间件知识.本次将对jvm有更深 ...
- 第37课 智能指针分析(指针特征操作符( -> 、 *)重载)
1. 永恒的话题:内存泄漏 (1)动态申请堆空间,用完后不归还 (2)C++语言中没有垃圾回收的机制 (3)指针无法控制所指堆空间的生命周期------------指针是变量,可以指向内存堆空间,但是 ...