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 ...
随机推荐
- kafka零拷贝
Kafka之所以那么快的另外一个原因就是零拷贝(zero-copy)技术.本文我们就来了解Kafka中使用的零拷贝技术为什么那么快. 传统的文件拷贝 传统的文件拷贝通常需要从用户态去转到核心态,经过r ...
- 小白从零开始阿里云部署react项目+node服务接口(二:node服务+web)
我们用极简的方式来创建服务,没有任何附加功能 1 新建一个server文件夹 2 使用npm init 或者yarn init 一路enter 3 yarn add express cors ...
- Getting Started with Recovery Manager (RMAN) (文档 ID 360416.1)
In this Document Purpose Scope Details Overview of the RMAN EnvironmentDeciding Whether to Use a Fla ...
- Logging with ElasticSearch, Kibana, ASP.NET Core and Docker
好久不见,前两周经历了人生第一次"伪牛市",基金和股市大起大落,更加坚信"你永远赚不到超出你认知范围之外的钱,除非靠着运气",老韭菜诚不欺我也. 当能力与野心不 ...
- SQL数据单条转多条(Lateral View)
Lateral View和split,explode等UDTF一起使用,它能够将一行数据拆成多行数据,并在此基础上对拆分后的数据进行聚合. 单个Lateral View语句语法定义如下:lateral ...
- CentOS7编译安装php7.1配置教程详解
这篇文章主要介绍CentOS7编译安装php7.1的过程和配置详解,亲测 ,需要的朋友可以参考. 1.首先安装依赖包: yum install libxml2 libxml2-devel openss ...
- 修改map中原来的各种Key
简单描述: 做数据迁移的时候,需要展示数据库的字段信息,但是我发现 Oracle的sql查询到的结果 出来默认是大写的 和 前端vue的参数小写开头+驼峰 不太一样 所以后台取到的数据都是是引用Lis ...
- 篮球30S定时器设计
一.设计介绍 本设计采用74LS192作为计数器,74LS192具有同步加减计数功能,可以通过引脚电平对它设置达到清零重置的目的,可以达到对计数器清零的功能,使用两片级联74LS192分别显示十位和个 ...
- Js数组对象的属性值升序排序,并指定数组中的某个对象移动到数组的最前面
需求整理: 本篇文章主要实现的是将一个数组的中对象的属性值通过升序的方式排序,然后能够让程序可以指定对应的数组对象移动到程序的最前面. 数组如下所示: var arrayData= [{name: & ...
- three.js 欧拉角和四元数
这篇郭先生就来说说欧拉角和四元数,欧拉角和四元数的优缺点是老生常谈的话题了,使用条件我就不多说了,我只说一下使用方法. 1. 欧拉角(Euler) 欧拉角描述一个旋转变换,通过指定轴顺序和其各个轴向上 ...