错误 349 (net::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION):我们收到了多个“Content-Disposition”标头

解决方案 »

  1.   

    都没有给出代码,怎么解决问题啊。IllegalComponentStateException 是在不合理或不正确时间内唤醒一方法时出现的异常信息
    jdk5.0文档中很清楚地介绍了出现IllegalStateException异常的可能情况: 1)同一个页面中再次调用response.sendRedirect()方法。 
    2)提交的URL错误,即不是个有效的URL。 google一下很多的解决办法,真对你的情况自己看看,
    但是看你给出的错误::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION
    看错误的意思是不是你的 headers有问题(文件名导致的),或者是你下载的文件太大导致的.看看这个
    http://stackoverflow.com/questions/12348242/debugging-multiple-disposition-headers
      

  2.   

    谢谢各位了,baidu,Google上的都看了下,没能找到合适的,但给了我灵感,我需要完成的是多文件下载。我的问题已经解决。谢谢!
      

  3.   

    response.setHeader("Content-Disposition", "attachment;fileName="
                      + java.net.URLEncoder.encode(fileName,"UTF-8"));
    这里的问题, 我把这个删了, 然后改了下struts.xml的配置
      

  4.   

    public class DownloadAction extends ActionSupport{
    private static final long serialVersionUID = -3036349171314867490L; 
        
        private String fileName; 
          
        public String getFileName() { 
            return fileName; 
        } 
      
        public void setFileName(String fileName) throws UnsupportedEncodingException { 
            this.fileName = new String(fileName.getBytes("ISO-8859-1"),"UTF-8"); 
        } 
          
        public InputStream getInputStream() throws UnsupportedEncodingException, FileNotFoundException{ 
               return new BufferedInputStream(new FileInputStream(fileName));
        } 
        
        @Override
        public String execute() throws Exception { 
            return SUCCESS; 
        } 
          
          
      
    }
      

  5.   

    <action name="download" class="com.*****" method="execute">
    <result name="success" type="stream"> 
                     <param name="contentType">application/octet-stream</param> 
                     <param name="inputName">inputStream</param> 
                     <param name="bufferSize">4096</param> 
                     <param name="contentDisposition">attachment;filename=${fileName}</param>
                </result> 
    </action>