- 浏览: 1891492 次
- 性别:
- 来自: 合肥
-
文章分类
- 全部博客 (514)
- OPEN (41)
- WARN (33)
- EXPER (16)
- RESOURCE (7)
- TOOL (4)
- DWR (10)
- Struts1.x (10)
- Ibtais (18)
- MyEclipse (30)
- Sql Server (64)
- Tomcat (7)
- APACHE (4)
- JSP (18)
- SERVLET (6)
- ENGLISH (0)
- ECSide (8)
- JasperReports (7)
- JAVA (24)
- JS (42)
- XML (26)
- CVS (8)
- Mind (1)
- JQUERY (2)
- IBATIS (6)
- PROJECT (0)
- STRUTS2 (0)
- PROXOOL (0)
- SPRING (4)
- Hibernate (0)
- SSI (0)
- JBPM (11)
- FLEX (3)
- JSON (2)
- GWT (1)
- jeecms v3 (1)
- Flash (2)
- DATA (1)
- ORACLE (3)
- 查询oracle 中逗号分隔字符串中所有值 (1)
最新评论
-
小小西芹菜:
GoEasy web三步轻松实现web实时推送1. 引入goe ...
服务器推送技术 java -
kg_1997:
这个方法太棒了,可以不用to_date函数,实在是棒!!!
java/oracle日期处理 -
wodesunday:
:idea:
SQL的分段统计查询语句 -
wodesunday:
引用
SQL的分段统计查询语句 -
BlueSkator:
讲的有点浅,没有深入进去
tomcat需要的重新发布和重启服务器的几种情况
一目了然的数据模型
As you have seen, the data-model is basically a tree.正如你所看到的,数据模型基本上是一个树。 This tree can be arbitrarily complicated and deep, for example:这种树可以任意复杂和深刻的,例如:
(root) (根)
| |
+- animals + - 动物
| | | |
| +- mouse | + - 鼠标
| | | | | |
| | +- size = "small" | | + - 大小=“小”
| | | | | |
| | +- price = 50 | | + - 价格= 50
| | | |
| +- elephant | + - 大象
| | | | | |
| | +- size = "large" | | + - 大小=“大”
| | | | | |
| | +- price = 5000 | | + - 价格= 5000
| | | |
| +- python | + - 蟒蛇
| | | |
| +- size = "medium" | + - 尺寸=“中等”
| | | |
| +- price = 4999 | + - 价格= 4999
| |
+- test = "It is a test" + - 测试=“这是一个测试”
| |
+- whatnot + - 诸如此类
| |
+- because = "don't know" + - 因为“不知道”
The variables that act as directories (the root, animals , mouse , elephant , python , whatnot ) are called hashes .充当目录(根, 动物 , 老鼠 , 大象 , 蟒蛇 , 诸如此类 )被称为哈希变量。 Hashes store other variables (the so called哈希存储其他变量(即所谓的 subvariables ) by a lookup name (eg, "animals", "mouse" or "price").查找名称(如“动物”,“鼠标”或“价格”) 的子变量) 。
The variables that store a single value ( size , price , test and because ) are called scalars .存储一个值( 尺寸 , 价格 , 测试和因为 )的变量被称为标量 。
When you want to use a subvariable in a template, you specify its path from the root, and separate the steps with dots.当您要使用的模板中的一个子变量,从根本上指定其路径,并用点分开的步骤。 To access the price of a mouse , you start from the root and go into animals , and then go into mouse then go into price .要访问鼠标的价格,从根开始, 进入动物,然后进入鼠标然后进入价格。 So you write animals.mouse.price .所以,你写animals.mouse.price。 When you put the special ${ ... } codes around an expression like this, you are telling FreeMarker to output the corresponding text at that point.当你把周围表达这样的特殊的$ {...}代码,你告诉FreeMarker的输出在这一点上相应的文本。
There is one more important kind of variable: sequences .还有一个更重要的一种变量: 序列 。 They are similar to hashes, but they don't store names for the variables they contain.它们类似于哈希,但他们不存储它们所包含的变量的名称。 Instead, they store the subvariables sequentially, and you can access them with a numerical index.相反,他们的子变量存储顺序,您可以访问数字索引。 For example, in this data-model, animals and whatnot.fruits are sequences:例如,在这个数据模型, 动物和whatnot.fruits序列:
(root) (根)
| |
+- animals + - 动物
| | | |
| +- (1st) | + - (第1)
| | | | | |
| | +- name = "mouse" | | + - 名称=“鼠标”
| | | | | |
| | +- size = "small" | | + - 大小=“小”
| | | | | |
| | +- price = 50 | | + - 价格= 50
| | | |
| +- (2nd) | + - (第2)
| | | | | |
| | +- name = "elephant" | | + - 名称=“大象”
| | | | | |
| | +- size = "large" | | + - 大小=“大”
| | | | | |
| | +- price = 5000 | | + - 价格= 5000
| | | |
| +- (3rd) | + - (第3)
| | | |
| +- name = "python" | + - 名称=“蟒蛇”
| | | |
| +- size = "medium" | + - 尺寸=“中等”
| | | |
| +- price = 4999 | + - 价格= 4999
| |
+- whatnot + - 诸如此类
| |
+- fruits + - 水果
| |
+- (1st) = "orange" + - (第1)=“橙”
| |
+- (2nd) = "banana" + - (第二)=“香蕉”
To access a subvariable of a sequence you use a numerical index in square brackets.要访问您使用方括号中的数字索引的一个序列的子变量。 Indexes start from 0 (it's a programmer tradition to start with 0), thus the index of the first item is 0, the index of the second item is 1, and so on.索引从0(从0开始,这是一个程序员的传统)开始,因此该指数的第一个项目是0,第二项的索引是1,依此类推。 So to get the name of the first animal you write animals[0].name .所以获得的第一个动物的名称, 你写的动物[0]。名称。 To get the second item in whatnot.fruits (which is the string "banana" ) you write whatnot.fruits[1] .在whatnot.fruits要获得的第二项(这是字符串“香蕉”),你写whatnot.fruits [1] 。
Scalars can be further divided into these categories:标量可进一步分为这些类别:
String: Text, that is, an arbitrary sequence of characters such as ''m'', ''o'', ''u'', ''s'', ''e'' above.字符串:文本,这是一个任意的字符,如序列“米”,“O”,“ü”,“S”,“E”上面。 For example the name -s and size -s are strings above.例如名称 - S和大小 - S是字符串以上。
Number: It's a numerical value, like the price -s above.编号:像s以上的价格 ,这是一个数值。 The string "50" and the number 50 are two totally different things in FreeMarker.字符串“50”和50号是两个完全不同的东西在FreeMarker。 The former is just a sequence of two characters (which happens to be readable as a number for humans), while the latter is a numerical value that you can use, say, in arithmetical calculations.前者仅仅是两个字符的序列(这恰好是一些对人类可读),而后者则是一个数值,您可以使用,例如在算术计算,。
Date/time: A date or time.日期/时间:日期或时间。 Like the date an animal were captured, or the time the shop opens.日期一样的动物被抓获,或打开店铺的时间。
Boolean: A true/false (yes/no, on/off, etc.) thing.布尔:一个真/假(是/否,开/关,等)的事情。 Like animals could have a protected subvariable, which store if the animal is protected or not.喜欢的动物可能有一个受保护的子变量,它存储如果动物是保护或不保护。
Summary:摘要:
The data-model can be visualized as a tree.数据模型可以可视化树。
Scalars store a single value.标量存储一个值。 The value can be a string or a number or a date/time or a boolean.该值可以是一个字符串或一个数字或日期/时间或布尔。
Hashes are containers that store other variables and associate them with a unique lookup name.哈希存储其他变量和一个独特的查找名称相关联的容器。
Sequences are containers that store other variables in an ordered sequence.序列是一个有序的序列,存储在其他变量的容器。 The stored variables can be retrieved via their numerical index, starting from 0.检索存储的变量可以通过其数字索引,从0开始。
As you have seen, the data-model is basically a tree.正如你所看到的,数据模型基本上是一个树。 This tree can be arbitrarily complicated and deep, for example:这种树可以任意复杂和深刻的,例如:
(root) (根)
| |
+- animals + - 动物
| | | |
| +- mouse | + - 鼠标
| | | | | |
| | +- size = "small" | | + - 大小=“小”
| | | | | |
| | +- price = 50 | | + - 价格= 50
| | | |
| +- elephant | + - 大象
| | | | | |
| | +- size = "large" | | + - 大小=“大”
| | | | | |
| | +- price = 5000 | | + - 价格= 5000
| | | |
| +- python | + - 蟒蛇
| | | |
| +- size = "medium" | + - 尺寸=“中等”
| | | |
| +- price = 4999 | + - 价格= 4999
| |
+- test = "It is a test" + - 测试=“这是一个测试”
| |
+- whatnot + - 诸如此类
| |
+- because = "don't know" + - 因为“不知道”
The variables that act as directories (the root, animals , mouse , elephant , python , whatnot ) are called hashes .充当目录(根, 动物 , 老鼠 , 大象 , 蟒蛇 , 诸如此类 )被称为哈希变量。 Hashes store other variables (the so called哈希存储其他变量(即所谓的 subvariables ) by a lookup name (eg, "animals", "mouse" or "price").查找名称(如“动物”,“鼠标”或“价格”) 的子变量) 。
The variables that store a single value ( size , price , test and because ) are called scalars .存储一个值( 尺寸 , 价格 , 测试和因为 )的变量被称为标量 。
When you want to use a subvariable in a template, you specify its path from the root, and separate the steps with dots.当您要使用的模板中的一个子变量,从根本上指定其路径,并用点分开的步骤。 To access the price of a mouse , you start from the root and go into animals , and then go into mouse then go into price .要访问鼠标的价格,从根开始, 进入动物,然后进入鼠标然后进入价格。 So you write animals.mouse.price .所以,你写animals.mouse.price。 When you put the special ${ ... } codes around an expression like this, you are telling FreeMarker to output the corresponding text at that point.当你把周围表达这样的特殊的$ {...}代码,你告诉FreeMarker的输出在这一点上相应的文本。
There is one more important kind of variable: sequences .还有一个更重要的一种变量: 序列 。 They are similar to hashes, but they don't store names for the variables they contain.它们类似于哈希,但他们不存储它们所包含的变量的名称。 Instead, they store the subvariables sequentially, and you can access them with a numerical index.相反,他们的子变量存储顺序,您可以访问数字索引。 For example, in this data-model, animals and whatnot.fruits are sequences:例如,在这个数据模型, 动物和whatnot.fruits序列:
(root) (根)
| |
+- animals + - 动物
| | | |
| +- (1st) | + - (第1)
| | | | | |
| | +- name = "mouse" | | + - 名称=“鼠标”
| | | | | |
| | +- size = "small" | | + - 大小=“小”
| | | | | |
| | +- price = 50 | | + - 价格= 50
| | | |
| +- (2nd) | + - (第2)
| | | | | |
| | +- name = "elephant" | | + - 名称=“大象”
| | | | | |
| | +- size = "large" | | + - 大小=“大”
| | | | | |
| | +- price = 5000 | | + - 价格= 5000
| | | |
| +- (3rd) | + - (第3)
| | | |
| +- name = "python" | + - 名称=“蟒蛇”
| | | |
| +- size = "medium" | + - 尺寸=“中等”
| | | |
| +- price = 4999 | + - 价格= 4999
| |
+- whatnot + - 诸如此类
| |
+- fruits + - 水果
| |
+- (1st) = "orange" + - (第1)=“橙”
| |
+- (2nd) = "banana" + - (第二)=“香蕉”
To access a subvariable of a sequence you use a numerical index in square brackets.要访问您使用方括号中的数字索引的一个序列的子变量。 Indexes start from 0 (it's a programmer tradition to start with 0), thus the index of the first item is 0, the index of the second item is 1, and so on.索引从0(从0开始,这是一个程序员的传统)开始,因此该指数的第一个项目是0,第二项的索引是1,依此类推。 So to get the name of the first animal you write animals[0].name .所以获得的第一个动物的名称, 你写的动物[0]。名称。 To get the second item in whatnot.fruits (which is the string "banana" ) you write whatnot.fruits[1] .在whatnot.fruits要获得的第二项(这是字符串“香蕉”),你写whatnot.fruits [1] 。
Scalars can be further divided into these categories:标量可进一步分为这些类别:
String: Text, that is, an arbitrary sequence of characters such as ''m'', ''o'', ''u'', ''s'', ''e'' above.字符串:文本,这是一个任意的字符,如序列“米”,“O”,“ü”,“S”,“E”上面。 For example the name -s and size -s are strings above.例如名称 - S和大小 - S是字符串以上。
Number: It's a numerical value, like the price -s above.编号:像s以上的价格 ,这是一个数值。 The string "50" and the number 50 are two totally different things in FreeMarker.字符串“50”和50号是两个完全不同的东西在FreeMarker。 The former is just a sequence of two characters (which happens to be readable as a number for humans), while the latter is a numerical value that you can use, say, in arithmetical calculations.前者仅仅是两个字符的序列(这恰好是一些对人类可读),而后者则是一个数值,您可以使用,例如在算术计算,。
Date/time: A date or time.日期/时间:日期或时间。 Like the date an animal were captured, or the time the shop opens.日期一样的动物被抓获,或打开店铺的时间。
Boolean: A true/false (yes/no, on/off, etc.) thing.布尔:一个真/假(是/否,开/关,等)的事情。 Like animals could have a protected subvariable, which store if the animal is protected or not.喜欢的动物可能有一个受保护的子变量,它存储如果动物是保护或不保护。
Summary:摘要:
The data-model can be visualized as a tree.数据模型可以可视化树。
Scalars store a single value.标量存储一个值。 The value can be a string or a number or a date/time or a boolean.该值可以是一个字符串或一个数字或日期/时间或布尔。
Hashes are containers that store other variables and associate them with a unique lookup name.哈希存储其他变量和一个独特的查找名称相关联的容器。
Sequences are containers that store other variables in an ordered sequence.序列是一个有序的序列,存储在其他变量的容器。 The stored variables can be retrieved via their numerical index, starting from 0.检索存储的变量可以通过其数字索引,从0开始。
发表评论
-
Apache FileUpload组件
2013-11-22 15:05 5475Apache FileUpload组件 在最初的 htt ... -
各种数据库对应的jar包、驱动类名和URL格式
2012-11-20 16:38 1534各种数据库对应的jar包、驱动类名和URL格式 2011 ... -
Java Web Start
2011-09-14 10:45 1366一.首先了解一下什么是java web start 1JNL ... -
The template at a glance一目了然的模板
2011-08-05 09:06 1513The template at a glance一目了然的模板 ... -
jeecms v3
2011-07-04 15:28 1594好久没有逛jeecms的官方论坛了,今天去看了下,jeecms ... -
gwt整合ibatis
2011-07-02 09:42 2108最近整合gwt整合ibatis,常见错误 控制台报错: 一.N ... -
GWT RPC原理浅析(二)
2011-06-17 16:14 2870前一篇介绍了RPC大体的流程,核心方法是RemoteServi ... -
GWT RPC原理浅析
2011-06-17 15:26 5358GWT中前后台交互有多种方式,包括JSON,XML,RPC 其 ... -
五种开源协议
2011-04-25 14:54 1132五种开源协议(BSD,Apache,G ... -
JAVA代码调用客户端摄像头 初步探讨
2011-02-21 16:51 6773首先到sun下载最新的jmf,然后安装。 然后,说一下 ... -
tomcat部署jbpm项目 loader constraint violation
2011-02-11 14:22 1813当tomcat部署jbpm项目 时,启动项目控制台出错 ja ... -
E3.Tree参考手册
2010-12-10 09:52 3603E3.Tree参考手册 (v1.0) 目录 简介 2 系统 ... -
e3.tree 1.5 发布,很好,很强大,有截图[转]
2010-12-07 14:14 1154E3.Tree是E3平台下一个用于构造树型UI(menu,tr ... -
在Action中获取ServletContext实例
2010-11-25 13:43 37831:在Action中获取servletContext的时候可以 ... -
Bean named 'sqlMapClient' must be of type [org.springframework.orm.ibatis.SqlMap
2010-11-22 09:57 4965在整合spring2.5和ibatis2,出现了ibatis的 ... -
spring,ibatis的笔记
2010-11-22 08:51 1070在上文中,我们把iface ... -
spring,ibatis的笔记
2010-11-22 08:51 990在上文中,我们把iface ... -
后台错误处理
2010-11-17 15:10 1350后台处理 if (!isTokenValid(request) ... -
struts1 和Spring整合jar包
2010-11-17 11:33 5032struts1 和Spring整合 struts1 和Spri ... -
spring 与struts的集成
2010-11-17 08:37 1299Struts与Spring的集成主要有两种方式,即Delega ...
相关推荐
本篇将深入探讨如何自定义FreeMarker标签,以扩展其功能并适应特定项目需求。 首先,理解FreeMarker的默认标签语法至关重要。FreeMarker使用${...}表达式来插入变量,#{...}用于输出注释,以及、等控制结构进行条件...
本教程将深入讲解Freemarker的核心概念、语法和实际应用,帮助你全面掌握这个模板语言。 1. **Freemarker简介** - Freemarker是一个开源的、轻量级的模板引擎,其核心功能是将数据模型与HTML模板结合,生成最终的...
而Freemarker则是一种轻量级的、基于模板的Java模板引擎,常用于Web应用中的动态内容生成,比如JSP替代技术。它允许开发者将业务逻辑与页面展示分离,提高代码的可维护性和可读性。 "eclipse的freemarker插件"是指...
Freemarker-IDE是一款专为开发人员设计的Eclipse插件,它主要针对Freemarker模板语言提供了强大的支持。在Eclipse这样的集成开发环境中,这款插件能够显著提升开发人员编写和调试`.ftl`(FreeMarker Template ...
`freemarker-2.3.23.jar`是Freemarker库的一个版本,发布于2.3.23,这个版本可能包含了对早期版本的一些改进、新功能或bug修复。 Freemarker的核心概念是模板语言,它是一种声明式的编程方式,允许开发者编写不包含...