Freemarker导出word的简单使用
1.模板
username:${username}
password:${password}
<#list mylist as item>
${item.name!}
${item.password!}
${item.sex!}
${item.phto!}
</#list >
2.Java类
package servlet; import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map; import org.junit.Test; import bean.TestFreemarkerBean;
import freemarker.template.Configuration;
import freemarker.template.Template; public class FreeMarkerExportWord { @Test
public void exportSimpleWord() throws Exception {
// 要填充的数据, 注意map的key要和word中${xxx}的xxx一致
Map<String, Object> dataMap = new HashMap<String, Object>();
dataMap.put("username", "张三");
dataMap.put("password", "男"); // Configuration用于读取ftl文件
Configuration configuration = new Configuration();
configuration.setDefaultEncoding("utf-8"); /*
* 以下是两种指定ftl文件所在目录路径的方式, 注意这两种方式都是 指定ftl文件所在目录的路径,而不是ftl文件的路径
*/
// 指定路径的第一种方式(根据某个类的相对路径指定)
configuration.setClassForTemplateLoading(this.getClass(), "");
// 指定路径的第二种方式,我的路径是C:/a.ftl
// configuration.setDirectoryForTemplateLoading(new File("C:/")); List<TestFreemarkerBean> list = new ArrayList<>();
list.add(new TestFreemarkerBean("乔治", "123456", "男", "wwwwwwww"));
list.add(new TestFreemarkerBean("乔治", "123456", "男", "wwwwwwww"));
list.add(new TestFreemarkerBean("乔治", "123456", "男", "wwwwwwww"));
list.add(new TestFreemarkerBean("乔治", "123456", "男", "wwwwwwww"));
list.add(new TestFreemarkerBean("乔治", "123456", "男", "wwwwwwww"));
list.add(new TestFreemarkerBean("乔治", "123456", "男", "wwwwwwww"));
list.add(new TestFreemarkerBean("乔治", "123456", "男", "wwwwwwww"));
list.add(new TestFreemarkerBean("乔治", "123456", "男", "wwwwwwww"));
list.add(new TestFreemarkerBean("乔治", "123456", "男", "wwwwwwww"));
list.add(new TestFreemarkerBean("乔治", "123456", "男", "wwwwwwww"));
dataMap.put("mylist", list);
// 输出文档路径及名称
File outFile = new File("F:/test.doc"); // 以utf-8的编码读取ftl文件
Template t = configuration.getTemplate("test2.ftl", "utf-8");
Writer out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outFile), "utf-8"), 10240);
t.process(dataMap, out);
out.close();
}
}
3.测试:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQEAAAFwCAIAAAA38FnOAAAYI0lEQVR4nO2dwZmjvBJFlQIxKAVyUAiKgQT+hVazJQMyIIGnCEhACZCBcuAt7teaGoGx3T2Inq57VmOwsdxTB0oClcxGiG7M3Q0g5GboANEOHSDaoQNEO3SAaIcOEO3QAaIdOkC0QweIdugA0Q4dINqhA0Q7dIBohw4Q7dABoh06QLRDB4h2rnLAGNpF/g3oANEOHSDaoQNEO3SgNeu6ln8755ZlubExZKMDDYgxjoK+78dxxC5jjFRi27ac8+e+ZRzHGONX26oSOnA5OedH5/7qr7QsS9/3lQbTNI3PCCEYY7quSyk1+EU/DDrQmkcO5Jy7rvPeV1eG6iX569CB1hw6kHPu+36e5/vapRc60ALvfclbrLWVAzlndo5vhA785utR2Pd913X7fq0M8RBCSW/QJx6GgQnPjVwVqf/9958xxjn3+5uMMcbIOIsx9n2P7d77EII8QtlrrS0DKdu2jePovcfZNOc8DAPes67ruq4hBGtt2d51nUwwcs54A750GAbE67IsaC06l977lJK1tus6OdjyqEmFVxyQGGOmaao2vqtizpkjQl/hwuvAOI7SgZyzdGBd15IV4Fwo3xxj7Lqu7JXjicgocCjv/bIsKSVjTEoJx0EQ47MxRjn+6L0vnU5kIMMwlMPiG9HOEAKE8d4/bdJTuq6Tf4cy1IO/ksR7b4ypOgbnQ0PQ8rwv8evXrxebqpB2DmBjcWBZlmqvfGmtlee2lJIMIxxqP4SyfZzR5ZlYfmkIQcaKbKH8d/mI3Pi0SY+Ah2UQs5i2fWSM+0tBxbqun75vAOjACbc5gJGQEEKMEf/BJaBxXt8fUCYJj858cODkg3hPSahedOCVJj0i51yaWpmPY8YYrxgRknFPB064zYHtIytADl1S8+0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EMHiHboANEOHSDaoQNEO3SAaIcOEO3QAaIdOkC0QweIdugA0U4LB9Z1PayPEmNEAWpjTFVDDiVVuq5D/bmTx0tRbEtuwack1dydcRwxi/+ksgvRw7UOhBAQ5ftH/zGrBiG4rmvf97KEhKwxgck0h8EaY8TkMrkRzkjkBANUfodvIYSu6/7ezyX/JNc6gDUHvPd7B6oS6tXMyWo2fd/3+ytJztla23Vd5UBVzU6Cef1FCdR9ef9nkR9Fu3lk9RcbU4W1dMB7Lx0odRclIYQQwn4y2snctH29R0Juc2Ce52r1gGr2sKTv++rNKSXkTm85UF1eCNludKAixni4NAH60/tEqEw1rhzA7E3UYER/unQkUOQLb9jvJWr5Lg4cDtE45xCpVTXScRzLUM/eAbl8E3q9+DgcwDgSyvRi6In1epXzLRwYhuHRqko5Z6wwUHKYaqS1cmBd1yrbsdbiDcWBam81clqgA0q434ETAeQRSqZUrVrwtFhdWf615EJyL3rV5SVrlSrkZgdeEWD7CF8kS+YBpXzvPnE6cUC2jfV6dXKnA1hJSW5BgGLpMRmsh+ELquuA97667eW9L/nP/p4xlnXaWK9XMXeOjVajPSklKIGIl3pg4b3Dg1cOOOeqw8qFP4ZhqEafrLVlL0NfJ5c7gAVVq4WY1nXFfWJJeS4IK9aUZyVijNUCNvLg1loZ9HgGCVkTRn7kjWEs+j0MA8aF8CiH7F3QAYVc6wAGNyXYjjP9HhmsWH8AY6OHN7aqg5dM6eRRvG3bUkrlyJDhyj8A+Qfgs9NEO3SAaIcOEO3QAaIdOkC0QweIdugA0Q4dINqhA0Q7dIBohw4Q7fwf39a+i5nrE0MAAAAASUVORK5CYII=" alt="" />
Freemarker导出word的简单使用的更多相关文章
- 使用Freemarker导出Word文档(包含图片)代码实现及总结
.personSunflowerP { background: rgba(51, 153, 0, 0.66); border-bottom: 1px solid rgba(0, 102, 0, 1); ...
- freemarker导出word带图片
导出word带图片 如果你需要在word中添加图片,那你就在第一步制作模板时,加入一张图片占位,然后打开xml文档,可以看到如下的一片base64编码后的代码: <w:binData w:nam ...
- freemarker导出word文档——WordXML格式解析
前不久,公司一个项目需要实现导出文档的功能,之前是一个同事在做,做了3个星期,终于完成了,但是在项目上线之后却发现导出的文档有问题,此时,这个同事已经离职,我自然成为接班者,要把导出功能实现,但是我看 ...
- freemarker导出word文档
使用freemarker导出word文档的过程 **************************************************************************** ...
- freemarker导出word档
1.word另存为xml:2.xml文件后缀名改成ftl:3.编写完整json字符串备用:4.修改ftl中动态字段为json中对应字段名:5.编写java代码自动生成word文件:(注意:换行用< ...
- freemarker导出word的一些问题
首先,了解下freemarker导出word的流程: 参考https://www.cnblogs.com/llfy/p/9303208.html 异常一: freemarker.core.ParseE ...
- 关于使用freemarker导出word
java使用FreeMarker导出word 一. 先做一个word模板 二. 将该word文件另存为xml格式(注意是另存为,不是直接改扩展名) 三. 打开xml文件把要 ...
- java freemarker导出word时添加或勾选复选框
最近项目导出word碰到一个需求,要求根据数据动态的决定word里的复选框是否勾选, 公司导出word用的是freemarker,相比较其他技术,freemarker可以很容易的控制输出样式, 在wo ...
- Java用freemarker导出word
概述 最近一个项目要导出word文档,折腾老半天,发现还是用freemarker的模板来搞比较方便省事,现总结一下关键步骤,供大家参考,这里是一个简单的试卷生成例子. 详细 代码下载:http://w ...
随机推荐
- Spring的编程式事务和声明式事务
事务管理对于企业应用来说是至关重要的,当出现异常情况时,它也可以保证数据的一致性. Spring事务管理的两种方式 spring支持编程式事务管理和声明式事务管理两种方式. 编程式事务使用Transa ...
- 自学Linux Shell5.2-shell内建命令history alias
点击返回 自学Linux命令行与Shell脚本之路 5.2-shell内建命令history alias 外部命令:有时称为文件系统命令,是存在于bash shell之外的程序,通常位于/bin./u ...
- 架构师成长之路6.6 DNS服务器搭建(构建企业级DNS)
点击返回架构师成长之路 架构师成长之路6.6 DNS服务器搭建(构建企业级DNS) 采用LVS-DR模式负载均衡,多IDC,多套DNS集群,通过master-slave技术保证dns配置的一致性. 1 ...
- [poj2528]Mayor's posters
题目描述 The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campa ...
- luogu1966 火柴排队(离散化+树状数组)
由于是一个二次函数的关系,所以易证应该尽量让两组的顺序相同 然后就离散化乱搞几发,最后就变成了求逆序对的数量了 #include<bits/stdc++.h> #define pa pai ...
- scrapy-redis爬取豆瓣电影短评,使用词云wordcloud展示
1.数据是使用scrapy-redis爬取的,存放在redis里面,爬取的是最近大热电影<海王> 2.使用了jieba中文分词解析库 3.使用了停用词stopwords,过滤掉一些无意义的 ...
- coursera吴恩达 机器学习编程作业原文件 及我的作业
保存在github上供广大网友下载:点击 8个zip,原文件,没有任何改动. 另外,不定期上传我自己关于这门课的学习过程笔记和心得,有兴趣的盆友可以点击这里查看.
- FinalHttp的简要介绍与使用
http://blog.csdn.net/zhaokaiqiang1992/article/details/30291259?utm_source=tuicool 在之前的一篇文章中,我们简单的介绍了 ...
- Java:在不同界面样式下JPopupMenu与鼠标事件mousePressed表现的结果不同!
今天遇到一个郁闷的事儿: 在一个JFrame上放了一个JList元件,这个JList元件添加了鼠标事件: mouseReleased.mousePressed ... 其中,在mouseRelease ...
- hiho一下 第144周(机会渺茫)解题报告及拓展
题目1 : 机会渺茫 时间限制:5000ms 单点时限:1000ms 内存限制:256MB 描述 小Hi最近在追求一名学数学的女生小Z.小Z其实是想拒绝他的,但是找不到好的说辞,于是提出了这样的要求: ...