zoukankan      html  css  js  c++  java
  • 没有图片的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 欢迎前来访问
  • 相关阅读:
    java语言体系的技术简介之JSP、Servlet、JDBC、JavaBean(Application)
    浅谈HTTP中Get与Post的区别
    浅谈HTTP中Get与Post的区别
    图文混排
    Algorithm: quick sort implemented in python 算法导论 快速排序
    algorithm: heap sort in python 算法导论 堆排序
    Leetcode OJ : Compare Version Numbers Python solution
    Python 同时for遍历多个列表
    Leetcode OJ : Repeated DNA Sequences hash python solution
    Leetcode OJ : Triangle 动态规划 python solution
  • 原文地址:https://www.cnblogs.com/chenyameng/p/11763673.html
Copyright © 2011-2022 走看看