백그라운드 내 보 내기

749 단어 JAVA
    @GetMapping("/exportPushUserModle")
    public void exportPushUserModle(HttpServletResponse response) throws Exception {
        response.setContentType("application/vnd.ms-excel;charset=utf-8");
        response.setCharacterEncoding("utf-8");
        response.addHeader("Content-Disposition", "attachment;filename=push_user.xls");
        ClassPathResource classPathResourceSimple = new ClassPathResource("/excel/push_user.xls");
        try (InputStream is = classPathResourceSimple.getInputStream()) {
            IOUtils.copy(is, response.getOutputStream());
        }
        response.flushBuffer();
    }
import org.apache.commons.io.IOUtils;

좋은 웹페이지 즐겨찾기