zhaoritian19
V2EX  ›  问与答

求教,关于 struts2 文件上传重复上传的问题 i

  •  
  •   zhaoritian19 · Dec 16, 2019 · 1854 views
    This topic created in 2365 days ago, the information mentioned may be changed or developed.

    各位大佬们,使用 struts2 上传文件,由于文件量过大,代码处理超过 5 分钟后会为什么会重新执行一次文件上传,请问这种情况怎么避免?是哪里的配置问题吗? 这里是我的 struts2 配置:

    <action name="realFlyTimeAdjustUpload_*" method="{1}" 			class="com.ceair.retrospect.dealcount.jlcount.action.RealFlyTimeAdjustUploadAction">
    
           <!-- 配置名字为 fileUpload 的拦截器 -->
          <interceptor-ref name="fileUpload">
            <!-- 配置允许上传的文件类型 xls,xlsx -->
             <param name="allowedTypes">application/excel,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/octet-stream</param>
            <!-- 配置允许上传文件的大小(单位字节) -->
          </interceptor-ref>
          <interceptor-ref name="defaultStack"></interceptor-ref>
                <!-- 动态设置保存文件的路径 (Action 的属性值)-->
          <param name="savePath">/file/fileUpload/flightTime</param>
           <result name="uploadRealFlyTimeAdjust" type="freemarker">WEB-INF/content/jlcount/importRealFlyTimeAdjust.ftl</result>
           <result name="result" type="json">
                <!-- IE 下导入完成 json 需以 text/heml 格式返回 否则一直要保存文件 -->
    
                <param name="contentType">text/html</param>
                <param name="root">resultMap</param>
           </result>
       </action>
    
    5 replies    2019-12-16 13:56:36 +08:00
    wysnylc
        1
    wysnylc  
       Dec 16, 2019
    我穿越了
    zhaoritian19
        2
    zhaoritian19  
    OP
       Dec 16, 2019
    @wysnylc 怎么了……
    ihciah
        3
    ihciah  
       Dec 16, 2019 via iPhone
    多不怕死用 struts2🤣
    zhaoritian19
        4
    zhaoritian19  
    OP
       Dec 16, 2019
    @ihciah 没办法啊 接手的旧的项目
    wc951
        5
    wc951  
       Dec 16, 2019 via Android
    struts2 爆了那么多漏洞还有人在用吗
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   912 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 41ms · UTC 19:31 · PVG 03:31 · LAX 12:31 · JFK 15:31
    ♥ Do have faith in what you're doing.