layout 文件如下:
<#-- layout.ftl Copyright 2010 Jack Leow Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <#import "/spring.ftl" as spring/> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Create Search Provider</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <link rel="stylesheet" href="<@spring.url "/css/main.css" />" type="text/css" /> <link rel="shortcut icon" href="<@spring.url "/favicon.ico" />" type="image/x-icon" /> ${htmlHead!""} </head> <body> <h1>Create Search Provider</h1> ${contentBody} <hr /> <div class="footer"> <a href="<@spring.url "/create.cgi" />">Home</a> / <a href="<@spring.url "/about.html" />">About</a> </div> <p>Copyright © 2009-${globals.currentTime?string("yyyy")} by Jack Leow (廖杰仁). All Rights Reserved.</p> <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> try { var pageTracker = _gat._getTracker("UA-5685732-4"); pageTracker._trackPageview(); } catch(err) {}</script> </body> </html>
调用layout, 展示页面
<#-- about.ftl Copyright 2010 Jack Leow Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <#assign contentBody> <h2>License</h2> <p>Copyright 2009-${globals.currentTime?string("yyyy")} Jack Leow.</p> <p> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at </p> <p> <a href="http://www.apache.org/licenses/LICENSE-2.0"> http://www.apache.org/licenses/LICENSE-2.0</a> </p> <p> Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. </p> </#assign> <#include "include/layout.ftl" />
相关推荐
Freemarker模板生成pdf+javaFreemarker模板生成pdf+javaFreemarker模板生成pdf+javaFreemarker模板生成pdf+javaFreemarker模板生成pdf+java
freemarker根据模板生成word,freemarker根据模板生成word,freemarker根据模板生成word
通过springboot 整合freemarker模板引擎,自动发送html格式邮件
基于Freemarker模板的纯Java代码实现的代码生成器工具
Java freemarker 模板生成word动态表格
Freemarker+poi 模板生成word+导入图片 直接导入eclipse即可,希望对大家有所帮助
大致的思路是先用office2003或者2007编辑好word的样式,然后另存为xml,将xml翻译为FreeMarker模板,最后用java来解析FreeMarker模板并输出‘.doc’ word文档。经测试这样方式生成的word文档完全符合office标准,...
FreeMarker概述 FreeMarker是一个模板引擎,一个基于模板生成文本输出的通用工具,使用纯Java编写 FreeMarker被设计用来生成HTML Web页面,特别是基于MVC模式的应用程序 虽然FreeMarker具有一些编程的能力...
freemarker java模板技术 很详细的注释 适合初学者,了解思路
freemarker生成word文档模板,配合文档使用,效果更佳。https://blog.csdn.net/xueshuiyy/article/details/86748009
附件包含了mybatis-plus自动生成代码,基于freemarker的模板。包括常规的curd。 【特点】针对每个接口都有对应的入参和出参,不公用entity。 如,add接口,则入参会自动生成为addEntityReq。具体可下载模板进行查看...
FreeMarker通用模板。FreeMarker 是一款 模板引擎: 即一种基于模板和要改变的数据, 并用来生成输出文本(HTML网页,电子邮件,配置文件,源代码等)的通用工具。 它不是面向最终用户的,而是一个Java类库,是一款...
FreeMarker导出模板,以及基本代码
使用freeMarker模板和Spring boot后端API接口实现查询用户列表的功能。 http://localhost:8080/ftl/index
简单的实现了java使用freemarker模板技术导出word的简单功能,不喜勿喷,网上很多的不详细
Java利用Freemarker模板自动生成dto、dao、rowmapper、bo、service代码,代码可以直接复制到项目中使用,代码是基于pring框架的
通过程序生成PDF文件, wkhtmltox-0.12.3.2_msvc2013-win64.exe html-url
1.这是一个在根目录下的mail.properties文件中配好发送邮件地址和接收邮箱地址的实例,利用freeMarker模板作为展示,在测试类中提供配固定接收邮箱地址和手动输入接收邮箱地址两种方法进行发送试验,结果都能实现...
Freemarker利用模板生成word的使用(java生成word),切记word模板制作用03版的,其他版本会报资源损坏的提示!
在这里将通过Freemarker这个模板引擎来实现导出 Word,项目不限于Swing,SSH,SSM,Spring Boot 之类的 ————————————— Spring Boot,Freemarker 编辑好格式的Word文档 1份 将Word文档里需要填充的地方...