这个问题我也很困惑~
同样的文件格式还有txt,Excel文件等等``

解决方案 »

  1.   

    呵呵,要专门写一个下载的Servlet,然后写上如下类似的下载文件信息
                response.setContentType("application/x-msdownload;charset=GB2312");
                response.setHeader("Content-Disposition", new String(sb.toString()
                    .getBytes(), "ISO8859-1"));然后读写一次文件流,把XML文件写入你的下载流中就OK了
      

  2.   

    如 dlxu(去东京的签证下来了) 所说:
    StringBuffer sb2 = null;//读xml文件内容到sb2
    ……ServletOutputStream sos = response.getOutputStream();
    sos.write(sb2.toString().getBytes("ISO-8859-1"));
    sos.flush();
    sos.close();最后调用这个servlet