做了一个上传文件的画面,画面上只有一个file框。选择文件,然后上传,由于文件比设置的最大size大,报如下错误。 FileUploadInterceptor : the request was rejected because its size (15428654) exceeds the configured maximum (11534336)这个时候这个拦截器被执行了两次,然后error就被输出了两次。望高人指点。

解决方案 »

  1.   

    限制功能我是要的,主要是FileUploadInterceptor被执行了两次,错误信息就在画面上出现两次 
      

  2.   

    以为defaultStack中已经包含FileUploadInterceptor,所以会执行两次。
    <action .........>
    <interceptor-ref name="defaultStack">
      <param name="fileUpload.maximumSize">1024</param>
      <param name="fileUpload.allowedTypes">text/html</param>
    </interceptor-ref>
    </action>
    这样就FileUploadInterceptor就只会执行一次了。