spring 스프링

Ambiguous handler methods mapped for HTTP path 오류

KIMSG 2017. 7. 21. 14:05

출처 : http://pep-si.tistory.com/20

1
2
3
4
5
심각: Servlet.service() for servlet [spring] in context with path [/library] threw exception [Request processing failed; nested exception is java.lang.IllegalStateException: Ambiguous handler methods mapped for HTTP path 'http://localhost:8080/library/mgr': {public java.lang.String com.sun.controller.MainController.mgr(org.springframework.ui.Model) throws java.lang.Exception, public java.lang.String baedo.baedoController.MgrController.list(int,org.springframework.ui.Model) throws java.lang.Exception}] with root cause
 
java.lang.IllegalStateException: Ambiguous handler methods mapped for HTTP path 'http://localhost:8080/library/mgr': {public java.lang.String com.sun.controller.MainController.mgr(org.springframework.ui.Model) throws java.lang.Exception, public java.lang.String baedo.baedoController.MgrController.list(int,org.springframework.ui.Model) throws java.lang.Exception}
 
 
cs


해결 방법: 하나의 URL을 여러개의 콘트롤러에서 매핑할 수 없다. 중복되는 url이 없도록 하나의 콘트롤러에서만 사용한다.