访问图片等静态资源返回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")

访问正常了。

转载于:https://www.cnblogs.com/srgk/p/8859222.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值