文件上傳到遠程服務器 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

在web.xml中輸入如下代碼

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

代碼的具體插入位置如下圖所示

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章