`
dengzhouit
  • 浏览: 13195 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

the request was rejected because its size (5263618) exceeds the configured maxim

阅读更多
解析:这个最大值是在struts2的源文件“struts2-core-2.0.11.1.jar\org\apache\struts\ default.properties”中的struts.multipart.maxSize=2097152语句,如果想改大的话,就重新设定它,有两种方法:
一种是重写:struts.properties文件。
二是在struts.xml中加入常量来改变它如“ Java代码
<constant name="struts.multipart.maxSize" value="10000000" />
当然了,也有struts2的拦截器可以限制文件的类型、大小等,但是当上传文件大小2M后,这个拦截器就不起作用了,只用小于2M(默认大小)的时候才起作用。那是因为:common-fileupload组件默认最大支持上传文件的大小为2M,当我们上传大于2M的文件时,就会出现上面所说的异常。是这个异常的发生导致了fileUpload拦截器没有机会执行,所以看到的是页面没有任何变化,也没有任何提示信息,只是在控制台打印出了上面的那些上传文件过大的异常。
我解决问题的过程:
刚开始只是在struts.xml文件最上部加入
<constant name="struts.multipart.maxSize" value="1000000000" />
pt">但还是报同样的错误。

接着查看struts.properties文件里的配置为:
### Load custom default resource bundles
struts.custom.i18n.resources=MessageResource
struts.multipart.maxSize=50097152

### character encoding
struts.i18n.encoding=GBK

修改为
### Load custom default resource bundles
struts.custom.i18n.resources=MessageResource
struts.multipart.maxSize=1000000000

### character encoding
struts.i18n.encoding=GBK
分享到:
评论

相关推荐

    The joint density of the maximum and its location

    Introduction It is of interest' to calculate the distribution of the value of the difference between the maximum and present values of a stock or ...maximum, its location, and the endpoint which we give.

    上传war文件大小超过Tomcat7最大文件限制报错

    the request was rejected because its size (66704562) exceeds the configured maximum (52428800)

    Struts2多文件上传与邮件附件发送

    the request was rejected because its size (16272982) exceeds the configured maximum (9000000) 2.fileUpload拦截器的maximumSize属性必须小于struts.multipart.maxSize的值。 struts.multipart.maxSize默认2M...

    idea上传代码到github时遇到的Push rejected: Push to origin/master was rejected

    当新创建的github仓库里已经有文件时,如果使用idea上传项目到这个仓库就会报错:Push rejected: Push to origin/master was rejected。 完整步骤记录及解决方法: 一、创建本地仓库: 选中我们需要创建本地仓库的...

    a project model for the FreeBSD Project.7z

    The total number of committers at that time was 269. Committers fall into three groups: committers who are only concerned with one area of the project (for instance file systems), committers who are...

    Zen.And.The.Art.Of.Motorcycle.Maintenance

    The book sold 5 million copies worldwide.[1] It was originally rejected by 121 publishers, more than any other bestselling book, according to the Guinness Book of Records.[1] The title is an ...

    Domain-Driven+Design+in+PHP-Packt+Publishing(2017).pdf

    The training was fantastic, and all the concepts that were swirling around in their minds prior to the trip suddenly became very real. However, they were the only two ...

    Senfore_DragDrop_v4.1

    version of Delphi and C++ Builder has its own package; DragDropD6.dpk for Delphi 6, DragDropD5.dpk for Delphi 5, DragDropC5.bpk for C++ Builder 5, etc. 4) Add the Drag and Drop Component Suite ...

    The equity risk premium a solution

    They rejected it because it could not explain high enough equity risk premia. They concluded that only non-Arrow-Debreu models would solve this 'puzzle'. Here, I re-specify their model, capturing the...

    weblogic 8.X 无限制

    The Server is not licensed for this operation.Connection rejected, the server license allows connections from only 5 unique IP addresses. 没有授权 提示5个IP访问的限制 解决办法: 从licensecodes.oracle...

    dengfeng520#xiaoshiguangBlog#Vue笔记1

    1、依赖工具去官网下载node2、安装和构建如果报The operation was rejected by your operating system.使用安

    大学英语四级历年真题及答案详解(2000年——2010年)

    4. A) The woman rejected the man's apology.  B) The woman appreciated the man's offer.  C) The man had forgotten the whole thing. D) The man had hurt the woman's feelings. 5. A) The woman is ...

    JLink_Windows_V648.zip

    DLL: JTAG: When only having 1 TAP in the JTAG chain and its matches the one for the configured CPU core but the TAP-ID was unknown, connect did not work. Fixed. DLL: Linux: Delayed / slowed execution ...

    word自动转化为chm

    Q: Error while loading Word document: “Call was rejected by callee”, “Command failed”, “The RPC server is unavailable”, etc. A: Connection to Microsoft Word may be blocked by the anti-virus ...

    Git发现git push origin master 报错的解决方法

    git push origin master 报错的解决方法,分享给大家,... [rejected] master -&gt; master (fetch first) error: failed to push some refs to 'git@github.com:kangvcar/Results-Systems--PHP.git' hint: Updates were r

    dashboard rejected接口重构

    dashboard rejected接口重构

    IIS7内容扩展安装包

    It seems that a recurring question/comment on that post though is from people with issues with the code being rejected when trying to relay email through “localhost” (an assumed running local SMTP ...

    SmsRejectedReceiver.rar_Rejected

    Receive Intent.SMS_REJECTED.

Global site tag (gtag.js) - Google Analytics