struts2上传文件拒绝访问

2018-05-15 16:03:55,758 ERROR [org.apache.struts2.dispatcher.multipart.MultiPartRequest] - <org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. c:\upload_37b61c0a_16362cf4b81__7fd8_00000000.tmp (拒绝访问。)>
2018-05-15 16:03:55,789 ERROR [org.apache.struts2.interceptor.FileUploadInterceptor] - <Processing of multipart/form-data request failed. c:\upload_37b61c0a_16362cf4b81__7fd8_00000000.tmp (拒绝访问。)>
2018-05-15 16:03:55,813 ERROR [org.apache.struts2.dispatcher.Dispatcher] - <Could not find action or result>
No result defined for action cn.com.cis.claim.common.regist.web.CommonRegistAction and result input - action - file:/G:/claim_7002/modules/webapp/WEB-INF/csses/struts/common/struts-regist-common.xml:143:2

别人写的上传文件的代码,我拉取下来,点击上传文件提交表单时,不进入相应的Action方法,而是直接返回result=“input”,页面上述错误。

最终发现问题的原因是struts.xml中有一个用于存放临时文件的路径:

<constant name="struts.xslt.nocache" value="false" />
<constant name="struts.multipart.saveDir" value="c:/" />
有些电脑可能c盘没有访问权限,改成其他路径即可:
<constant name="struts.xslt.nocache" value="false" />
<constant name="struts.multipart.saveDir" value="d:/" />




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值