Ambiguous mapping. Cannot map ‘xxxController‘ method
程序员文章站
2022-03-08 15:50:47
...
我自己是同时写了两个GetMapping发生了冲突
@GetMapping
public Object getPageData(Integer currentPage,Integer offset){
//分页:select * from limit 10,10
//int beginIndex = (currentPage-1)*pageSize;
// PageHelper.offsetPage(index,pagesize); 当前端传入索引,就使用该方法
Page<User> page = PageHelper.startPage(currentPage, offset);
userMapper.selectList(Wrappers.emptyWrapper());
PageBean<User> pageBean = new PageBean<>();
pageBean.setData(page.getResult());
pageBean.setCurrentPage(page.getPageNum());
pageBean.setTotal(page.getPages());
return pageBean;
}
//只能有一个无参数的getMapping
@GetMapping
public Object get(){
List<User> users = userMapper.selectList(Wrappers.emptyWrapper());
return users;
}
这个报错一般都是类似问题
上一篇: 2019/03/13 java.lang.IllegalStateException: Ambiguous mapping found. Cannot map '' bean method
下一篇: springboot Ambiguous mapping. Cannot map ‘xxxxController‘ method
推荐阅读
-
Ambiguous mapping Cannot map ‘ XXController‘ method,已解决
-
Ambiguous mapping found. Cannot map 'xxx' bean method
-
java.lang.IllegalStateException: Ambiguous mapping found. Cannot map 'userInfoController' bean metho
-
Ambiguous mapping found. Cannot map 'XXXController' bean method”解决方法
-
Ambiguous mapping found. Cannot map 'xxxController' bean method
-
java.langIllegalStateException: Ambiguous mapping found. Cannot map 'outAppliController' bean method
-
Spring mvc Ambiguous mapping found. Cannot map controller bean method
-
java报错大全java.lang.IllegalStateException: Ambiguous mapping Cannot map xxx
-
解决“Ambiguous mapping. Cannot map ‘indexController‘ method”报错,其实很简单,只是不够细心
-
Ambiguous mapping found. Cannot map 'xxxController' bean method