一.编辑模板 替换地方以变量标记如“案件编号”可写成{caseNo} template.xml 二.准备数据 以HashMap封装数据,原理是替换模板中的变量 三.替换操作 选择输出位置:writePath WordUtil.printWordbyXMLWithOutputPath(templateFile, writePath, filename, dataMap); /** * 打印word文档(传入参数需要传入输出文件的保存路径的) * @param templateFile * @par…