Tag: mv

找到Spring mvc Ambiguous mapping。 无法映射控制器bean方法

我正在尝试构建一个应用程序,它可以列出数据库中的一些值,并在必要时使用Spring 4进行修改,添加,删除,并且我收到以下错误(仅当我的两个控制器文件中都存在“@Controller”注释时,如果我从其中一个文件中删除注释,但我在控制台中收到一条消息“找不到映射…在带有名称的dispatcherservlet中…”: INFO : org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping – Mapped “{[/edit/{id}],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}” onto public java.lang.String com.bookReview.app.BookController.editBook(int,org.springframework.ui.Model) WARN : org.springframework.web.context.support.XmlWebApplicationContext – Exception encountered during context initialization – cancelling refresh attempt org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0’: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Ambiguous mapping found. Cannot map ‘reviewController’ bean method public java.lang.String com.bookReview.app.ReviewController.editReview(int,org.springframework.ui.Model) to {[/edit/{id}],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}: There […]