现在用
html:file实现读取文件内容到画面上。发现一个问题,选择完文件之后,手动把文件删除掉,这时候点读取,仍然能够读到内容。
这时缓存问题吗?或者是?
struts文件处理

解决方案 »

  1.   

    jsp<html:file styleClass="input_file_1000" property="storeInfoFile"  value="storeInfoFile.fileName" styleId="storeInfoFile" /> <div class="right_button">
                            <input type="button" class="button" value="读取" onclick="VwsSubmit('Import');" />
                        </div>        
      

  2.   


    XfUploader uploader = new XfUploader(FormFile);
    uploader.open();
    .........................public class XfUploader {
    ...........................
     public void open() throws IOException, FileNotFoundException {        this.inStreamReader = null;
            this.reader = null;
            InputStream inStream = this.formFile.getInputStream();
            this.inStreamReader = new InputStreamReader(inStream);
            this.reader = new BufferedReader(this.inStreamReader);
        }
    }
      

  3.   

    可能是有缓存吧,建议debug模式下一步步跟进去看看