spring MVC 的@RequestMapping注解在同一个controller内映射同一个地址两次会怎样

晚上加班,一次疏忽下映射了一个url(i)两次,如图:

spring MVC 的@RequestMapping注解在同一个controller内映射同一个地址两次会怎样_第1张图片

 

 

 

你问我结果怎样?

 

 

 

 

 

 

 

肯定是启动Tomcat时报错了啊,哈哈哈哈哈哈

 

一下是报错信息:

org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:457)Context initialization failed
org.springframework.beans.factory.BeanCreationException:

Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0': Initialization of bean failed; nested exception is java.lang.IllegalStateException: Ambiguous mapping found. Cannot map 'pgContractController' bean method 
public

java.lang.String com.ztds.pg.contract.ctrl.PgContractController.SearchFinishContractjList(org.springframework.web.context.request.WebRequest,javax.servlet.http.HttpServletRequest,org.springframework.ui.Model,com.ztds.pg.contract.model.PgContractForm)

你可能感兴趣的:(Java,MVC,让人头疼的异常)