没有图片的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; }*/
没有图片的freemarker下载,备份的更多相关文章
- [.ashx檔?泛型处理程序?]基础入门#5....ADO.NET 与 将DB里面的二进制图片还原 (范例下载 & 大型控件的ImageField)
[.ashx檔?泛型处理程序?]基础入门#5....ADO.NET 与 将DB里面的二进制图片还原 (范例下载 & 大型控件的ImageField) http://www.dotblogs.c ...
- 【iOS系列】-多图片多线程异步下载
多图片多线程异步下载 开发中非常常用的就是就是图片下载,我们常用的就是SDWebImage,但是作为开发人员,不仅要能会用,还要知道其原理.本文就会介绍多图下载的实现. 本文中的示例Demno地址,下 ...
- python------接口(get请求、post请求), 图片、歌曲下载,网页返回,上传文件
接口(get请求.post请求 --json), 图片.歌曲下载(context),网页返回(text),上传文件 import requests######################### ...
- java读取网页图片路径并下载到本地
java读取网页图片路径并下载到本地 最近公司需要爬取一些网页上的数据,自己就简单的写了一个demo,其中有一些数据是图片,需要下载下来到本地并且 将图片的路径保存到数据库,示例代码如下: packa ...
- C++ 根据图片url 批量 下载图片
最近需要用到根据图片URL批量下载到本地的操作.查找了相关资料,记录在这儿. 1.首先在CSV文件中提取出url ifstream fin("C:\\Users\\lenovo\\Deskt ...
- 在C#中使用正则表达式筛选出图片URL并下载图片URL中的图片到本地
本功能主要用到的知识点如下: 1.正则表达式 2.C#中下载文件功能的实现 3.泛型集合的使用 4.进程的简单操作(用于结束当前程序) 下面就简单说一下是如何使用这些知识点的.先详细说下这个程序主要实 ...
- python图片爬虫 - 批量下载unsplash图片
前言 unslpash绝对是找图的绝佳场所, 但是进网站等待图片加载真的令人捉急, 仿佛是一场拼RP的战争 然后就开始思考用爬虫帮我批量下载, 等下载完再挑选, 操作了一下不算很麻烦, 顺便也给大家提 ...
- [Python_scrapy图片爬取下载]
welcome to myblog Dome地址 爬取某个车站的图片 item.py 中 1.申明item 的fields class PhotoItem(scrapy.Item): # define ...
- 如何删除 Win10此电脑 desktop 视频 图片 文档 下载 音乐等文件夹
更改注册表; 1. WIN+R 输入[regedit] 打开注册表管理器 2. 找到路径[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curren ...
随机推荐
- unity学习 5.x打包
using System.Collections;using System.Collections.Generic;using UnityEngine;using UnityEditor; publi ...
- Zabbix常用监控项整理
zabbix常用key:http://blog.51cto.com/ttxsgoto/1771752 linux主机cpu使用率超过90%的时候报警:https://blog.csdn.net/reb ...
- 学习4412开发板gdb和gdbserver的调试
因为有很多的小伙伴是从单片机转过来的,用惯了单片机上的JLINK调试程序,换到Linux上非常的不习惯.确实,如果能设置断点,单步调试,查看变量,那确实是太爽了,那么在我们的Linux可以做到吗,答案 ...
- 4418开发板基于Linux-c测试程序的编译和运行
基于iTOP4418开发板的Linux-c的测试程序iTOP-4418 开发板可以运行的文件系统很多,在具体的文件系统上实现特定功能前,可以使用 Linux-c 程序来测试硬件以及驱动.而且这些程序很 ...
- 以puppeteer抓取微指数,puppeteer基本示例,docker部署headless
还是直接上代码 https://github.com/cclient/weizhishu-puppeteer 根据关键字获取微博指数 早期版本以常规的构造cookie,token,sign的访问api ...
- PostgreSQL 安装之 CentOS 7 x64 RPM 安装
PostgresQL 安装环境 一.CentOS 7 安装 1. 环境说明 CentOS7 PosgreSQL 11.2 2. 在线安装 到目前为止(2019-08-10),CentOS7 默认携带了 ...
- made his acquaintance|adequate|advisable|announce|contrived to|made up|toss|considering that
PHRASE 与(某人)初次相识;结识(某人)When you make someone's acquaintance, you meet them for the first time and ge ...
- Excel-DNA开发包:ExcelDna-0.34.6.zip下载
Excel-DNA可以用VB.Net或C#开发Excel自定义函数.制作.xll格式的加载宏. 点此下载 ExcelDna-0.34.6.zip
- php防止post数据刷新重复刷新。后退 等重复提交?
目前测试最好的办法:同步令牌(Token)机制来解决Web应用中重复提交的问题.还在研究中,稍后带来
- [LC] 392. Is Subsequence
Given a string s and a string t, check if s is subsequence of t. You may assume that there is only l ...