【错误处理】上传文件出错returned a response status of 405 Method Not Allowed,400

在使用Tomcat8和Windows 10环境下,通过IDEA部署时,遇到上传文件报405 Method Not Allowed和400错误。可能原因包括:Tomcat不允许写入请求、文件名解析问题、URL错误。解决方法涉及修改Tomcat的web.xml配置以允许HTTP写入操作,对文件名进行转码处理,并检查并修正上传URL。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

异常

Type 异常报告

消息 Request processing failed; nested exception is com.sun.jersey.api.client.UniformInterfaceException: PUT http://localhost:9090/spring_file_server_war_exploded/upload/a19dfbef613d4127926c0ccd82881376_SnapShot_2020-03-17_15-51-14.png returned a response status of 405 Method Not Allowed

描述 服务器遇到一个意外的情况,阻止它完成请求。

Exception

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is com.sun.jersey.api.client.UniformInterfaceException: PUT http://localhost:9090/spring_day2_file_server_war_exploded/upload/a19dfbef613d4127926c0ccd82881376_SnapShot_2020-03-17_15-51-14.png returned a response status of 405 Method Not Allowed
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:986)
	org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:881)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
	org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值