freemarker中文手册文档
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
FreeMarker
FreeMarker Java
FreeMarker HTML Web MVC FreeMarker Java FreeMarker
FreeMarker Web Web
FreeMarker HTTP Servlet FreeMarker Web
FreeMarker Model2 Struts JSP
FreeMarker
1
HTML XML RTF Java
Servlet
Email Web Web
2
include if/elseif/else
HTML
3
FreeMarker Java Java
JavaBean XML SQL
4 Web
Web HTML
Model2 Web JSP
JSP
MVC
5
UNICODE
US
6 XML
<#recurse> <#visit> 2.3 XML
XML
FreeMarker (1)
1
1 + =
FreeMarker
—— HTML Web
Web
HTML FreeMarker
Welcome ${user}!
Our latest product:
${}!
HTML ${…} FreeMarker FreeMarker Template user latestProduct.url data model
(root)
|
+- user = "Big Joe"
|
+- latestProduct
|
+- url = "products/greenmouse.html"
|
+- name = "green mouse"
latestProduct user url name url name latestProduct
FreeMarker
Welcome Big Joe!
Our latest product:
2
(root)
|
+- animals
| |
| +- mouse
| | |
| | +- size = "small" | | |
| | +- price = 50
| |
| +- elephant
| | |
| | +- size = "large" | | |
| | +- price = 5000
| |
| +- python
| |
| +- size = "medium" | |
| +- price = 4999
|
+- test = "It is a test"
|
+- whatnot
|
+- because = "don't know"
hashes
scalars
scalars
scalars root “. animals.mouse.price
sequences hashes
(root)
|
+- animals
| |
| +- (1st)
| | |
| | +- name = "mouse"
| | |
| | +- size = "small"
| | |
| | +- price = 50
| |
| +- (2nd)
| | |
| | +- name = "elephant" | | |
| | +- size = "large"
| | |
| | +- price = 5000
| |
| +- (3rd)
| |
| +- name = "python"
| |
| +- size = "medium"
| |
| +- price = 4999
|
+- whatnot
|
+- fruits
|
+- (1st) = "orange"
|
+- (2nd) = "banana"
scalars animals[0].name
3
FreeMarker
${…} interpolations FreeMarker
FTL FreeMarker HTML HTML # @
<#-- -->