--------------------------------------------------------------------------------------
4)include:用于包含其他的模板文件
语法:<#include path> or <#include path options>
path: The path of the file to include; an expression that evaluates to a string. (With other words, it doesn't have to be a fixed string, it can also be something like, for example, profile.baseDir + "/menu.ftl".)
options: One or more of these: encoding=encoding, parse=parse
encoding: Expression evaluates to string
parse: Expression evaluates to boolean (also accepts a few string values for backward compatibility)
example1:
<#-- struts2中主题xhtml下的select.ftl文件 -->
<#include "/${parameters.templateDir}/${parameters.theme}/controlheader.ftl" />
<#include "/${parameters.templateDir}/simple/select.ftl" />
<#include "/${parameters.templateDir}/xhtml/controlfooter.ftl" />
5) assign:用于定义变量或者替换存在的变量
语法:<#assign name=value>
or
<#assign name1=value1 name2=value2 ... nameN=valueN>
or
<#assign same as above... in namespacehash>
or
<#assign name>
capture this
#assign>
or
<#assign name in namespacehash>
capture this
#assign>
name: name of the variable. It is not expression. However, it can be written as a string literal, which is useful if the variable name contains reserved characters, for example <#assign "foo-bar" = 1>. Note that this string literal does not expand interpolations (as "${foo}").
value: the value to store. Expression.
namespacehash: a hash that was created for a namespace (by import). Expression.
6)import: 导入一个库到模板中,FreeMarker为导入库创建新的命名空间
语法:<#import path as hash>
path: The path of a template. This is an expression that evaluates to a string.
(With other words, it doesn't have to be a fixed string, it can also be something like, for example, profile.baseDir + "/menu.ftl".)
hash: The unquoted name of hash variable by which you can access the namespace. Not an expression.
Example1:
<#--使用命名空间-->
<#import "/template/simple/test.ftl" as my>
<#assign var1="dangdang2" in my>
${my.var1} ========================================================================
7.内置函数 - 参阅FreeMarker Manual
8.杂项
1)宏 - 宏是和某个变量关联的模板片段,以便在模板中通过用户定义指令使用该变量。
Example1:<#macro greet>
Hello world!
#macro>
<#--使用宏-->
<@greet>@greet>
-----------------------------------------------------------------------------------------
(1) 嵌套内容 - 用户定义指令可以有嵌套内容,使用<#nested>指令执行指令开始和结束标记之间的模板片段
Example2:<#macro border>
--分组取最大最小常用sql--测试环境if OBJECT_ID('tb') is not null drop table tb;gocreate table tb( col1 int, col2 int, Fcount int)insert into tbselect 11,20,1 union allselect 11,22,1 union allselect 1
一、函数的使用
1.1、定义函数变量
var vName = funcation(params){
}
1.2、函数的调用
函数变量的调用: vName(params);
函数定义时自发调用:(function(params){})(params);
1.3、函数中变量赋值
var a = 'a';
var ff
Mac mini 型号: MC270CH-A RMB:5,688
Apple 对windows的产品支持不好,有以下问题:
1.装完了xp,发现机身很热虽然没有运行任何程序!貌似显卡跑游戏发热一样,按照那样的发热量,那部机子损耗很大,使用寿命受到严重的影响!
2.反观安装了Mac os的展示机,发热量很小,运行了1天温度也没有那么高
&nbs
Follow up for "Search in Rotated Sorted Array":What if duplicates are allowed?
Would this affect the run-time complexity? How and why?
Write a function to determine if a given ta