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 欢迎前来访问
  • 相关阅读:
    在线网络考试系统源码
    zabbix通过api 批量自动添加主机
    python 连接数据库 区分线上和测试环境
    python 获取本机ip win or linux
    redis常用参数以及redis内存淘汰机制
    nginx常用配置
    Linux基础命令(之一)详解
    linux系统重要子目录介绍
    Linux系统根目录结构介绍
    Linux 基础优化配置
  • 原文地址:https://www.cnblogs.com/chenyameng/p/11763673.html
Copyright © 2011-2022 走看看