| | |
| | | public TemplateCreateController() { |
| | | configuration = new Configuration(); |
| | | configuration.setDefaultEncoding("utf-8"); |
| | | // 使用classpath加载模板,而不是文件系统 |
| | | configuration.setClassForTemplateLoading(this.getClass(), "/template"); |
| | | } |
| | | |
| | | |
| | |
| | | AppointmentDO appointment = appointmentService.getAppointment(id); |
| | | getData(dataMap, appointment); |
| | | |
| | | String filePath = getClass().getResource("/template/").getPath(); |
| | | configuration.setDirectoryForTemplateLoading(new File(filePath)); |
| | | |
| | | // 确保模板是Word XML格式 |
| | | Template t = configuration.getTemplate("知情同意运动试验.ftl"); |
| | |
| | | AppointmentDO appointment = appointmentService.getAppointment(id); |
| | | getData(dataMap, appointment); |
| | | |
| | | String filePath = getClass().getResource("/template/").getPath(); |
| | | configuration.setDirectoryForTemplateLoading(new File(filePath)); |
| | | |
| | | // 确保模板是Word XML格式 |
| | | Template t = configuration.getTemplate("食管心脏电生理知情同意书.ftl"); |