1

我在 Internet Explorer 中为 excel 文件上传 struts 2 文件时遇到问题。它在 Chrome 和 firefox 中运行良好,但我不确定我在 IE 中缺少什么。

这是我拥有的struts配置:

<action name="uploadAction" method="submitServiceProfile" class="serviceProfileAction">
             <!-- <interceptor-ref name="exception"/>
             <interceptor-ref name="i18n"/> -->
             <interceptor-ref name="fileUpload">
                 <param name="allowedTypes">application/ms-excel,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</param>
                 <!-- <param name="maximumSize">20480</param> -->
             </interceptor-ref>
             <interceptor-ref name="params">
                 <param name="excludeParams">dojo\..*,^struts\..*</param>
             </interceptor-ref>
             <interceptor-ref name="validation">
                 <param name="excludeMethods">input,back,cancel,browse</param>
             </interceptor-ref>
             <interceptor-ref name="store">
                 <param name="operationMode">STORE</param>
            </interceptor-ref>
            <interceptor-ref name="someStack"/>

            <result name="success" type="redirectAction">managerPage</result>
             <result name="error" type="redirectAction">managerPage</result>
             <result name="input" type="tiles">homepage</result>

         </action>
4

1 回答 1

0

正如user497087(谢谢!)所建议的那样,我完全删除了allowedTypes,以及interceptor-ref“fileupload”。现在,请求在任何给定的浏览器上都没有问题地进入操作。

于 2013-02-21T21:10:24.140 回答