Spring mvc Ambiguous mapping found. Cannot map controller bean method

前端 未结 4 1948
悲&欢浪女
悲&欢浪女 2020-12-15 15:39

I am trying to build an app which can list some values from the database and modify, add, delete if necessary using Spring 4 and i receive the following error(only if the \"

4条回答
  •  眼角桃花
    2020-12-15 16:09

    You should write

    @Controller("/review")
    public class ReviewController {
    

    and

    @Controller("/book")
    public class BookController {
    

    because in your code you have the two methods without an explicit/unique path for mapping(eg. if we have a call /edit/1 , this is impossible clearly to determine a controller's method from your editBook BookController or ReviewController editReview)

提交回复
热议问题