Problem: errors caused by mapping duplication
The Java code is as follows:
@RequestMapping (value = "/info/{remove}/{id}", method = requestmethod.get) public String Removenewsbyid (@ Pathvariable ("id") long ID) {
@RequestMapping (value = "/info/{fav}/{id}", method = requestmethod.get) public String Increasefavoritebyid (@ Pathvariable ("id") long ID) {
Report the following error:
Message Request processing failed; Nested exception is java.lang.IllegalStateException:Ambiguous handler methods mapped for HTTP path ' http://localhost:808 0/ZC-BEAUTY2/NEWS/INFO/FAV/6 ': {public java.lang.String com.zc.beauty.controller.NewsController.removeNewsById ( Long), public java.lang.String com.zc.beauty.controller.NewsController.increaseFavoriteById (Long)}
My intention was to visit/info/remove/id and/info/fav/id respectively.
There is a problem with the notation: variables wrapped with {} appear to be blurred:
/info/{remove}/{id} and
/info/{fav}/{id}
The mappings are duplicates.
Second, the solution:
Written in the following format:
/info/remove/{id}
Do not add {} for the determined path parameter
Problem solving.
The above describes the ambiguous handler methods mapped for HTTP path, including aspects of the content, I hope to be interested in the JSP tutorial friends helpful.
Transfer from http://www.codes51.com/article/detail_161369.html
Ambiguous handler methods mapped for HTTP path