public void service(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        Date start = new Date();
        ServletOutputStream out = null;
   
        FileInputStream input = null;
        String sign = "";
        sign = request.getParameter("sign");
 
        BufferedOutputStream bos = null;
        try {
           // zip files and generate a new zip file
           response.setContentType("application/octet-stream");
           response.setHeader("Content-Disposition", "attachment;filename=\""
                    + fileName + "\"");
                
                File file = new File(path + fileName);
                out = response.getOutputStream();
                
                input = new FileInputStream(file);
                bos = new BufferedOutputStream(out);
                //set the length of bytes while reading or writing 
                byte[] buf = new byte[1024 * 100];                int size = 0;
                while ((size = input.read(buf)) != -1) {
                    //out.write(buf, 0, size);
                    bos.write(buf, 0, size);
                }
                bos.flush();                                         //  A
                System.out.println("" + response.isCommitted());     //  B
    
                Date end = new Date();            } catch (Exception e) {            }
      }
1,程序实现的功能:从服务器端下载到客户端。
2,用response.getOutputStream()下载时,运行bos.flush();后在客户端弹出保存窗口,当客户没有点击保存时,文件的保存不执行。但是,程序继续进行执行下面的代码块。
在这种情况下,如何根据客户端的响应来进行判断,在进行下面的处理。
3,在解释一下,在A行的代码执行后,弹出保存窗。但是程序并不等待客户端的响应,继续执行B行的代码。!!!  请问
如何在A行的代码后根据客户的请求进行程序的控制???大师们,多谢了!!急呀!!!!
急呀!!!!