@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的更多相关文章

  1. Ambiguous mapping. Cannot map 'labelInfoController' method

    使用springboot项目中,启动时出现Ambiguous mapping. Cannot map 'labelInfoController' method , 原因是,@RequestMappin ...

  2. Ambiguous mapping. Cannot map 'registerController' method

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappi ...

  3. Caused by: java.lang.IllegalStateException: Ambiguous mapping. Cannot map 'userController' method

    在使用SpringMVC的时候遇到了这个问题 问题原因:  在指定方法所对应的url地址的时候重复了, 也就是@RequestMapping("url")中, 两个方法使用了同一个 ...

  4. Ambiguous mapping. Cannot map 'appController' method

    笔者最初的一套代码模板 import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Controller; impo ...

  5. java.lang.IllegalStateException: Ambiguous mapping. Cannot map 'waterQuality

    如果一个项目中有两个@RequestMapping("/xxx")完全相同就会报  java.lang.IllegalStateException 改进办法:修改@RequestM ...

  6. Java--- Ambiguous mapping. Cannot map "***Controller" been method解决办法

    打开网页报错: Ambiguous mapping. Cannot map 'handController' method  public com.smallchill.core.toolbox.aj ...

  7. SpringMVC“Ambiguous mapping found. Cannot map 'XXXController' bean method”解决方法

    [转 :http://www.fanfanyu.cn/news/staticpagefile/2351.html] 最近在开发项目的过程中SpringMVC抛了个"Ambiguous map ...

  8. Ambiguous mapping found. Cannot map 'xxxxController' bean method

    1.背景 今天要做一个demo,从github上clone一个springmvc mybatis的工程(https://github.com/komamitsu/Spring-MVC-sample-u ...

  9. Ambiguous mapping found. Cannot map 'competeController' bean method

    报错: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMapp ...

随机推荐

  1. Ethical Hacking - NETWORK PENETRATION TESTING(23)

    Detecting ARP Posionning Attacks ARP main security issues: 1. Each ARP requests/response is trusted. ...

  2. 从连接器组件看Tomcat的线程模型——NIO模式

    Tomcat8之后,针对Http协议默认使用org.apache.coyote.http11.Http11NioProtocol,也就是NIO模式.通过之前的博客分析,我们知道Connector组件在 ...

  3. 【JVM之内存与垃圾回收篇】执行引擎

    执行引擎 执行引擎概述 执行引擎属于 JVM 的下层,里面包括 解释器.及时编译器.垃圾回收器 执行引擎是 Java 虚拟机核心的组成部分之一. "虚拟机"是一个相对于" ...

  4. 【Java面试】- 并发容器篇

    JDK 提供的并发容器 ConcurrentHashMap: 线程安全的 HashMap CopyOnWriteArrayList: 线程安全的 List,在读多写少的场合性能非常好,远远好于 Vec ...

  5. 火狐浏览器如何使用二次验证码/虚拟MFA/两步验证/谷歌验证器?

    一般点账户名——设置——安全设置中开通虚拟MFA两步验证 具体步骤见链接  火狐浏览器如何使用二次验证码/虚拟MFA/两步验证/谷歌验证器? 二次验证码小程序于谷歌身份验证器APP的优势 1.无需下载 ...

  6. 细说websocket快速重连机制

    文|马莹莹 网易智慧企业web前端开发工程师 引言 在一个完善的即时通讯应用中,websocket是极其关键的一环,它为web应用的客户端和服务端提供了一种全双工的通信机制,但由于它本身以及其底层依赖 ...

  7. Redis一站式管理平台工具,支持集群创建,管理,监控,报警

    简介 Redis Manager 是 Redis 一站式管理平台,支持集群的创建.管理.监控和报警. 集群创建:包含了三种方式 Docker.Machine.Humpback: 集群管理:支持节点扩容 ...

  8. UltraISO制作系统安装盘

    转载自: 原文链接 本文介绍使用UltraISO(软碟通)制作U盘启动来安装Win10系统,会装win10,其他的系统也大同小异,适用于当原系统损坏.崩溃.升级异常导致系统不能开机时重装,相对比< ...

  9. cmd 安装第三方库问题

    pip install 包名 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com 一定要指定 信任豆瓣源,不然就算换了源 ...

  10. NodeJS 极简教程 <1> NodeJS 特点 & 使用场景

    NodeJS 极简教程 <1> NodeJS 特点 & 使用场景 田浩 因为看开了所以才去较劲儿.   1. NodeJS是什么 1.1 Node.js is a JavaScri ...