00006-java 下载一个excel模板(文件),前端layui按钮
2021-01-17 01:12
标签:out commons entity adc file ram var for gets 对应方法: java 控制层: customer.xlsx 是放在webapp/template目录下。 00006-java 下载一个excel模板(文件),前端layui按钮 标签:out commons entity adc file ram var for gets 原文地址:https://blog.51cto.com/14816966/2496779downTemplate:function () {
window.open(ctx+"/download/template/customer");
},
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
@Controller
@RequestMapping("/download")
public class DownloadController {
private Logger logger = LoggerFactory.getLogger(getClass());
@RequestMapping(value = "/template/customer")
public ResponseEntity
下一篇:Java 判断图片色彩
文章标题:00006-java 下载一个excel模板(文件),前端layui按钮
文章链接:http://soscw.com/index.php/essay/42961.html