code: public void writeFile(String fn, HttpServletResponse res) {
  
          ValidationFileUtil.initFileSendHeader(res, ValidationFileUtil.getEncodingFileName(fn + ".xls"), null);
  
          try {
              this.workBook.write(res.getOutputStream());
          } catch (IOException e) {
              throw new ValidationLibException("workbook write error  : " + e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR, e);
          }
      }
docs: Write file.
  
  @param fn  the fn
  @param res the res