访问图片等静态资源返回405

2018-04-16 22:57:09.201 DEBUG org.springframework.boot.web.filter.OrderedRequestContextFilter Line:114 - Bound request context to thread: org.apache.catalina.connector.RequestFacade@3bc8deb6
2018-04-16 22:57:09.202 WARN  org.springframework.web.servlet.PageNotFound Line:215 - Request method 'GET' not supported
2018-04-16 22:57:09.202 WARN  org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver Line:189 - Resolved exception caused by Handler execution: org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'GET' not supported
2018-04-16 22:57:09.203 DEBUG org.springframework.boot.web.filter.OrderedRequestContextFilter Line:104 - Cleared thread-bound request context: org.apache.catalina.connector.RequestFacade@3bc8deb6
2018-04-16 22:57:09.204 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory Line:251 - Returning cached instance of singleton bean 'basicErrorController'
2018-04-16 22:57:09.205 DEBUG org.springframework.core.env.PropertySourcesPropertyResolver Line:152 - Found key 'spring.template.provider.cache' in PropertySource 'refresh' with value of type String
2018-04-16 22:57:09.207 DEBUG org.springframework.core.env.PropertySourcesPropertyResolver Line:152 - Found key 'spring.template.provider.cache' in PropertySource 'refresh' with value of type String
2018-04-16 22:57:09.208 DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory Line:251 - Returning cached instance of singleton bean 'error'
spring boot项目,突然访问图片返回了405。

把晚上新写的代码用注释的方式找了几下,是一个预留的controller没有写路径所导致。

@PutMapping 改成 @PutMapping("/path")

访问正常了。

posted @ 2018-04-16 23:17  SrGK  阅读(542)  评论(0编辑  收藏  举报