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>
...

版权声明:本文为博主原创文章,未经博主允许不得转载。

最新文章

  1. Angular Mobile UI API文档
  2. web api 开发记录
  3. C++学了这么多年,你也许不知道为什么类定义要放在.h文件,类实现放在cpp文件。它们如何关联?
  4. 越狱Season 1-Episode 13: End of the Tunnel
  5. 对App数据库元素进行简单的设计
  6. DIV上下居中
  7. odoo10源码 windows环境安装
  8. KFCM算法的matlab程序(用FCM初始化聚类中心)
  9. Strut2页面传参跳转 --Struts2
  10. ElasticSearch聚合分析
  11. [PHP] 算法-两个n位的二进制整数相加问题PHP实现
  12. cookie存值 后取值是string string字符串转对象
  13. [洛谷P1417 烹调方案]贪心+dp
  14. [中英对照]Introduction to DPDK: Architecture and Principles | DPDK概论: 体系结构与实现原理
  15. 20155234 exp4 恶意代码分析
  16. @property的使用方法
  17. http-equiv制作跳转欢迎页面
  18. 【Tomcat】使用记录
  19. Latex 附录生成方法-附使用的一些tips
  20. 版本控制工具——SVN

热门文章

  1. jquery 增加与删除数组元素
  2. cannot find module &#39;xxx&#39; 解决办法
  3. 物联网通信 - RESTDemo示例程序(Python版本)
  4. 从“顶点小说”下载完整小说——python爬虫
  5. 20155232 2016-2017-3 《Java程序设计》第4周学习总结
  6. java IO操作:FileInputStream,FileOutputStream,FileReader,FileWriter实例
  7. c++编译器处理 函数返回值
  8. JavaWeb(十七)——JSP中的九个内置对象
  9. DDD实战成绩管理---需求分析
  10. python5