zoukankan      html  css  js  c++  java
  • struts2文件上传突破2M限制



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



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

    today lazy . tomorrow die .
  • 相关阅读:
    linux修改主机名
    selinux详解及配置文件
    linux磁盘分区
    识别光纤,模块
    free命令详解
    Linux系统修改网卡名(eth0-3)
    CentOS7的systemctl使用
    ELK集群
    ELK故障:elk在运行一段时间后,没有数据。
    superviosrd进程管理
  • 原文地址:https://www.cnblogs.com/france/p/4808622.html
Copyright © 2011-2022 走看看