Here is the actual code:
@RequestMapping(value = "/competitors/{id}", method = RequestMethod.GET) public Competitor getCompetitor(@PathVariable("id") long id) { Competitor competitor = competitorService.getCompetitorById(id); if (null == competitor) { EmptyResultDataAccessException e = new EmptyResultDataAccessException(1); logger.log(Level.WARN, e.getMessage()); throw e; } return competitor; } @RequestMapping(value = "/competitors/{id}", method = RequestMethod.DELETE) public String deleteCompetitor(@PathVariable("id") long id) { Competitor competitor = new Competitor(); competitor.setId(id); competitorService.deleteCompetitor(competitor); return "Solid gone!"; } Sending a DELETE request to /competitors/200 results in the error:
"HTTP Status 405 - Request method 'DELETE' not supported"
The logging from Spring confirms that no route to this method can be found:
5559 [tomcat-http--3] DEBUG org.springframework.web.servlet.DispatcherServlet - DispatcherServlet with name 'dispatcher' processing DELETE request for [/vrsboserver/competitors/200] 5562 [tomcat-http--3] DEBUG org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Matching patterns for request [/competitors/200] are [/competitors/{id}] 5565 [tomcat-http--3] DEBUG org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapping [/competitors/200] to handler 'com.gtspt.vrsboserver.controllers.CompetitorController@4fe7f80' 5565 [tomcat-http--3] DEBUG org.springframework.web.servlet.mvc.WebContentInterceptor - Looking up cache seconds for [/competitors/200] 5565 [tomcat-http--3] DEBUG org.springframework.web.servlet.mvc.WebContentInterceptor - Applying default cache seconds to [/competitors/200] 5566 [tomcat-http--3] DEBUG org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver - Resolving exception from handler [com.gtspt.vrsboserver.controllers.CompetitorController@4fe7f80]: org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'DELETE' not supported 5567 [tomcat-http--3] DEBUG org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver - Resolving exception from handler [com.gtspt.vrsboserver.controllers.CompetitorController@4fe7f80]: org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'DELETE' not supported 5568 [tomcat-http--3] DEBUG org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver - Resolving exception from handler [com.gtspt.vrsboserver.controllers.CompetitorController@4fe7f80]: org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'DELETE' not supported 5568 [tomcat-http--3] WARN org.springframework.web.servlet.PageNotFound - Request method 'DELETE' not supported To which my response is "BUH?".