• 没有图片的freemarker下载,备份


    没有图片的freemarker下载,备份

     //以下代码也可以使用/* public String exportApproveCase(@PathVariable("proId") Integer proId, HttpServletRequest request) throws Exception {     //获取项目名TJ-IKC     String path = request.getContextPath();     System.out.println(path);     //获取工程目录     //绝对路径:request.getSession().getServletContext()     String finalPath = request.getSession().getServletContext().getRealPath(path);     System.out.println(finalPath);     String templatePath = "/templates/docTemplates/";     //指定文件存储的路径     java.io.File file = new java.io.File(finalPath + File.separator + "upload");     System.out.println(file.getName());     if (!file.exists() && !file.isDirectory()) {         file.mkdir();     }     java.io.File file1 = new java.io.File(finalPath + File.separator + "upload" + File.separator + "案例报告");     if (!file1.exists() && !file1.isDirectory()) {         file1.mkdir();     }     //获取保存路径的绝对地址     String savePath = "/upload/案例报告/";     String finalSavePath = request.getSession().getServletContext().getRealPath(savePath);     System.out.println(finalSavePath);     //封装数据     Map<String, Object> dataMap = new HashMap<>();     DocUtil docUtil = new DocUtil();     //时间转换     Calendar calendar = Calendar.getInstance();     String data = calendar.get(Calendar.YEAR) + "." + calendar.get(Calendar.MONTH) + "." + calendar.get(Calendar.DATE);     //查找出来单个难题数据     Problem problem = new Problem();     problem = caseService.findByCategoryAndId(proId);     ModelAndView modelAndView = new ModelAndView();     modelAndView.addObject("problem", problem);     dataMap.put("proTitle", problem.getProTitle());     dataMap.put("proLevel", problem.getProLevel());     dataMap.put("proIndustry", problem.getProIndustry());     dataMap.put("proCompany", problem.getProCompany());     dataMap.put("proKeyword", problem.getProKeyword());     dataMap.put("proTheory", problem.getProTheory());     dataMap.put("proFunction", problem.getProFunction());     dataMap.put("proBackgroud", problem.getProBackgroud());     dataMap.put("proAbstract", problem.getProAbstract());     dataMap.put("proDescription", problem.getProDescription());     dataMap.put("proSolution", problem.getProSolution());     dataMap.put("proResult", problem.getProResult());     String fileName = "case" + ".doc";     docUtil.write(templatePath, "caseTemplate.ftl", dataMap, finalSavePath, fileName);     String filePath = "/upload/案例报告/" + fileName;     return filePath; }*/
    
    博客网站 https://yamon.top 个人网站 https://yamon.top/resume GitHub网站 https://github.com/yamonc 欢迎前来访问
  • 相关阅读:
    【Hadoop学习之七】Hadoop YARN
    【Hadoop学习之六】MapReduce原理
    【Hadoop学习之五】win7+Eclipse+hadoop3搭建本机开发环境
    【Hadoop学习之四】HDFS HA搭建(QJM)
    【Hadoop学习之三】Hadoop全分布式安装
    【Hadoop学习之二】Hadoop伪分布式安装
    【Hadoop学习之一】Hadoop介绍
    【Linux学习十】负载均衡带来tomcat的session不一致问题
    【Linux学习九】负载均衡
    Okhttp3基本使用
  • 原文地址:https://www.cnblogs.com/chenyameng/p/11763673.html
Copyright © 2020-2023  润新知