struts2文件上传突破2M限制
2024-10-20 16:35:27
struts配置文件
<action name="upload" class="strutsFileUpload">
<result name="input" type="redirect">/admin/ChangePhoto.jsp</result>
<result name="adminSuccess" type="redirect">/admin/index2.jsp</result>
<result name="userSuccess" type="redirect">/admin/index.jsp</result>
<interceptor-ref name="defaultStack">
<param name="fileUpload.maximumSize">1000000000</param>
<param name="fileUpload.allowedTypesSet">image/jpg,image/png,image/jpeg</param>
</interceptor-ref>
</action>
在最上面加一句
<constant name="struts.multipart.maxSize" value="9000000"/>
就可以5M 其他的类推
<struts>
<constant name="struts.i18n.encoding" value="GBK"></constant>
<constant name="struts.multipart.maxSize" value="9000000"/>
<package name="fileUpload" namespace="/" extends="struts-default">
<action name="showUpload">
<result>/admin/ChangePhoto.jsp</result>
</action> <action name="upload" class="strutsFileUpload">
<result name="input" type="redirect">/admin/ChangePhoto.jsp</result>
<result name="adminSuccess" type="redirect">/admin/index2.jsp</result>
<result name="userSuccess" type="redirect">/admin/index.jsp</result>
<interceptor-ref name="defaultStack">
<param name="fileUpload.maximumSize">1000000000</param>
<param name="fileUpload.allowedTypesSet">image/jpg,image/png,image/jpeg</param>
</interceptor-ref>
</action>
...
版权声明:本文为博主原创文章,未经博主允许不得转载。
最新文章
- Angular Mobile UI API文档
- web api 开发记录
- C++学了这么多年,你也许不知道为什么类定义要放在.h文件,类实现放在cpp文件。它们如何关联?
- 越狱Season 1-Episode 13: End of the Tunnel
- 对App数据库元素进行简单的设计
- DIV上下居中
- odoo10源码 windows环境安装
- KFCM算法的matlab程序(用FCM初始化聚类中心)
- Strut2页面传参跳转 --Struts2
- ElasticSearch聚合分析
- [PHP] 算法-两个n位的二进制整数相加问题PHP实现
- cookie存值 后取值是string string字符串转对象
- [洛谷P1417 烹调方案]贪心+dp
- [中英对照]Introduction to DPDK: Architecture and Principles | DPDK概论: 体系结构与实现原理
- 20155234 exp4 恶意代码分析
- @property的使用方法
- http-equiv制作跳转欢迎页面
- 【Tomcat】使用记录
- Latex 附录生成方法-附使用的一些tips
- 版本控制工具——SVN
热门文章
- jquery 增加与删除数组元素
- cannot find module &#39;xxx&#39; 解决办法
- 物联网通信 - RESTDemo示例程序(Python版本)
- 从“顶点小说”下载完整小说——python爬虫
- 20155232 2016-2017-3 《Java程序设计》第4周学习总结
- java IO操作:FileInputStream,FileOutputStream,FileReader,FileWriter实例
- c++编译器处理 函数返回值
- JavaWeb(十七)——JSP中的九个内置对象
- DDD实战成绩管理---需求分析
- python5