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 ...
随机推荐
- 使用Java带你打造一款简单的英语学习系统
[一.项目背景] 随着移动互联网的发展,英语学习系统能结构化的组织海量资料.针对用户个性需求,有的放矢地呈现给用户,从而为英语学习者提供便利,提升他们的学习效率. [二.项目目标] 1. 实现美观的界 ...
- java的干儿子锁Lock
目录 Lock的由来 线程之间的交互 Lock方法简介 lock() lockInterruptibly() trylock() trylock(long,TimeUnit) unlock() new ...
- MAC地址和交换机
数据链路层主要关注三个问题: 这个包是发给谁的?谁应该接收? 大家都在发,会不会产生混乱?有没有谁先发.谁后发的规则? 如果发送的时候出现了错误,怎么办? 数据链路层也称为MAC(Medium Acc ...
- Java中使用断言
由于断言在Java程序中用于开发和测试阶段,考虑到以后很有可能会用到,在此先记类一下. 在Java语言中,给出了3种处理系统错误的机制: 1.抛出一个异常 2.日志 3.使用断言 什么时候使用断言呢? ...
- P3756 [CQOI2017]老C的方块
题目链接 看到网格图+最优化问题,当然要想黑白染色搞网络流.不过这道题显然无法用黑白染色搞定. 仔细观察那四种图形,发现都是蓝线两边一定有两个格子,两个格子旁边一定还有且仅有一个格子.因此我们可以这么 ...
- jspang 做个那个pos系统--学习笔记
/为什么不能使用Object.assign() //使用Object.assign之后数据会发生改变,但是试图没有跟新 <template> <div class="pos ...
- Dart中final和const关键字
final和const 如果您从未打算更改一个变量,那么使用 final 或 const,不是var,也不是一个类型. 一个 final 变量只能被设置一次,两者区别在于:const 变量是一个编译时 ...
- 使用ATOMac进行Mac自动化测试
ATOMac简介 atomac是一个支持在mac上做自动化的python库,GitHub地址如下: https://github.com/pyatom/pyatom 安装 # Python2 sudo ...
- Javascript 组成:ECMAscript、Dom、Bom
一.核心(ECMAScript) ECMAScript 定义的只是这门语言的基础,而在此基础之上可以构建更完善的脚本语言. 二.浏览器对象模型(BOM)——对应window对象 window:窗口 w ...
- 友好城市dp
// // Created by Arc on 2020/4/27. //对了,这篇题解的代码是小白自己写的.有啥错误还请各位大佬多多包涵. /* * 某国有一条大河(一条大河~~~~,波浪宽~~~~ ...