欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

文件上传到远程服务器 a response status of 405 Method Not Allowed

程序员文章站 2022-04-14 13:40:43
...

文件上传到远程服务器 a response status of 405 Method Not Allowed

报错代码如下所示

严重: Servlet.service() for servlet [springmvc] in context with path [] threw exception [Request processing failed; nested exception is com.sun.jersey.api.client.UniformInterfaceException: PUT http://192.168.8.125:8080/upload/1981fed4-65a6-4708-a891-b854b6bfa8a5.jpg returned a response status of 405 Method Not Allowed] with root cause
com.sun.jersey.api.client.UniformInterfaceException: PUT http://192.168.8.125:8080/upload/1981fed4-65a6-4708-a891-b854b6bfa8a5.jpg returned a response status of 405 Method Not Allowed

解决方案:

修改tomcat的web.xml

文件上传到远程服务器 a response status of 405 Method Not Allowed文件上传到远程服务器 a response status of 405 Method Not Allowed

在web.xml中输入如下代码

<init-param>
    <param-name>readonly</param-name>
    <param-value>false</param-value>
</init-param>	

代码的具体插入位置如下图所示

文件上传到远程服务器 a response status of 405 Method Not Allowed