• 没有图片的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 欢迎前来访问
  • 相关阅读:
    linux时间设置相关
    tcp/ip协议和http协议
    redis和memcache的比较
    How to Display Image In Picturebox in VC++ from Iplimage and Mat
    关于技术与业务的理解
    怎样写出好代码——设计原则
    怎么写出好代码——坏味道
    linux 用户管理
    浅谈ajax
    浅析闭包和内存泄露的问题
  • 原文地址:https://www.cnblogs.com/chenyameng/p/11763673.html
Copyright © 2020-2023  润新知