- 浏览: 28207 次
- 性别:
- 来自: 杭州
-
最新评论
Single quotes will ensure that the quoted value will be assigned to the reference as is. Double quotes allow you to use velocity references and directives to interpolate, such as "Hello $name", where the $name will be replaced by the current value before that string literal is assigned to the left hand side of the =
#set( $a = "Velocity" )
单引号不解析 双引号解析
## This is a single line comment.
The Property $customer.Address has the exact same effect as using the Method $customer.getAddress()
<input type="text" name="email" value="$!email"/> !表示可为空 否则输出 $email
Now when the form is initially loaded and $email still has no value, an empty string will be output instead of "$email".
References to instance variables
in a template are not resolved. Only references to the attribute
equivalents of JavaBean getter/setter methods are resolved (i.e. $foo.Name does resolve to the class Foo's getName() instance method, but not to a public Name instance variable of Foo).
#[[don't parse me!]]#
<table>
#foreach( $customer in $customerList )
<tr><td>$foreach.count
</td><td>$customer.Name</td></tr>
#end
</table>
#foreach( $customer in $customerList )
$customer.Name#if( $foreach.hasNext
),#end
#end
$foreach.index
0开头
$foreach.first and $foreach.last
$foreach.parent or $foreach.topmost
#break
#include ---- The contents of the file are not rendered
through the template engine.
The #parse script element allows the template designer to import a local file that contains VTL. Velocity will parse the VTL and render the template specified.
(e.g. #break($macro)). This will stop rendering of all scopes up to the specified one
#break($foreach.parent
The #stop directive stops any further rendering and execution of the template.
短路方式,render马上结束
The example below will display abc.
#set($source1 = "abc")
#set($select = "1")
#set($dynamicsource = "$source$select")
## $dynamicsource is now the string '$source1'
#evaluate($dynamicsource)
#define( $block )Hello $who#end
#set( $who = 'World!' )
$block
display Hello World!
Note that the range operator only produces the array when used in conjunction with #set and #foreach directives
发表评论
-
深入了解字符集和编码
2012-03-09 17:21 935一、什么是字符集?什么是编码? 字符(Characte ... -
精确解释Unicode
2012-03-09 14:34 893转自 http://blog.csdn.net/gqqnb/a ... -
[转]字符编码详解及由来(UNICODE,UTF-8,GBK)
2012-03-08 17:55 734from http://blog.csdn.net/st ... -
[转]java InputStream读取数据问题
2012-01-30 11:25 929http://www.cnblogs.com/MyFa ... -
windows 文件名 正则表达式
2011-09-30 17:14 2273一个简单的windows 文件名 正则表达式,不检查文件名如 ... -
jquery contenttype 的变化
2011-09-15 12:31 2467jquery 1.4 的contenttype 默认是 ... -
[转]HD9001: 各浏览器对 URI 中非 ASCII 字符的处理有差异
2011-08-25 15:56 1097作者:孙东国 标准参考 URI 的组成如下所示: ... -
常见js 桌面参数
2011-08-16 16:06 0<body> <SCRIPT LANG ... -
【原创】css position 总结
2011-08-15 15:17 832参考了http://www.kei.tw/blogger/39 ... -
【原创】各种编码的关系
2011-07-02 15:54 1030以下为个人总结,有问题欢迎指出。 ASCII 8位 I ... -
【转】Facebook 的系统架构
2011-06-13 14:27 966来源:http://www.quora.co ... -
[转]java并发编程实践笔记
2011-04-07 17:27 7881, 保证线程安全的三种方法 :a, 不要跨线程访问共享变 ... -
[原创]AutoResetEvent, ManualResetEvent的Java模拟
2011-04-07 16:39 3043AutoResetEvent, ManualResetE ... -
[转]java 线程小结
2011-04-07 16:23 10231, 为什么wait与notify之前必须要加synchr ... -
[转]Java集合的五点体会
2011-04-06 10:17 688The Collections classes in j ...
相关推荐
【Velocity模板语言(VTL)详解】 Velocity模板语言(Velocity Template Language, VTL)是Apache Velocity引擎的核心组成部分,设计用于在Web开发中分离表现层和业务逻辑。它的主要目的是让非程序员,尤其是网页设计...
### Velocity 语法笔记 #### 一、Velocity 概述与基本用法 Velocity 是一个基于 Java 的模板引擎,主要用于 Web 应用程序中生成动态页面。它提供了丰富的语法支持,使得开发者可以更轻松地处理数据并将其转换为...
### Velocity学习笔记精要 **一、Velocity简介与特点** Velocity是一种基于Java的模板引擎,用于将静态数据和动态内容结合在一起,生成最终的HTML、XML或其他格式的文档。其最大的特点是性能高、易于理解和使用,...
Velocity是Apache软件基金会的一个开源项目,它是一款快速、强大且易用的模板引擎,用于生成动态Web内容。在Java世界中,Velocity常被用来作为MVC框架中的视图层技术,与Struts2等框架集成,以实现更灵活的页面渲染...
### Velocity 用户手册中文版知识点概览 #### 一、Velocity 概述 - **定义**:Velocity 是一款基于 Java 的模板引擎(template engine),能够帮助开发者轻松地利用模板语言(template language)引用 Java 代码中...
7. **模板引擎**:如FreeMarker或Velocity的使用,用于动态生成HTML页面。 8. **异常处理**:在Java Web中的全局异常处理机制,以及如何自定义异常类。 9. **安全问题**:如防止SQL注入、XSS攻击和CSRF攻击的策略...
大数据时代的特征可以概括为“3V+3高”,即海量的数据量(Volume)、多样化的数据类型(Variety)、快速的数据流(Velocity),以及高并发、高可扩展性和高性能等要求。 通过狂神的Redis笔记,我们可以系统地学习...
在实际开发中,Struts2支持多种视图技术,如JSP、FreeMarker、Velocity等,使得开发者可以根据项目需求选择最适合的模板语言。Action结果类型也是多样化的,可以返回字符串、Stream、甚至重定向或转发到其他页面。 ...
如Velocity或Freemarker作为模板引擎,可以生成动态HTML内容,实现前后端分离。 在"狂神说springmvc笔记.zip"中,读者可以通过深入学习这些知识点,掌握SpringMVC的使用技巧和最佳实践,提升自己的Java Web开发...
- **视图**:负责向用户展示界面,通常使用 JSP 或模板技术如 FreeMarker 和 Velocity。 - **控制器**:处理用户的请求,协调模型和视图,使用 Servlet、Action 实现。 **1.3 Struts2 的特性** - **单点控制**:...
* 大数据的5个特点:volume(规模大)、variety(类型多)、velocity(速度快)、value(有价值)、veracity(真实性) 大数据技术属性 * 云计算:一种无处不在的、便捷的且按需的对一个共享的可配置的计算资源...
从给定的文件信息来看,这里涉及到的是WebWork框架的学习笔记与配置,以及如何将WebWork与Spring、Hibernate集成在一起的示例。下面,我们将详细地解析这些知识点: ### WebWork框架简介 WebWork是一个开源的Java ...
在大数据时代,Nosql通常需要应对3V问题(Volume、Variety、Velocity)以及3高的要求(High concurrency、High availability、High performance),因此Nosql数据库在设计时会特别考虑这些问题。 狂神的Redis笔记不...
"bigdata笔记1"可能包含的是对大数据基础知识、主要技术框架及其应用的概述。以下是一些可能涵盖的重要知识点: 1. **大数据定义**:大数据不仅仅是数据的量大,它还包括数据的多样性、速度和价值。大数据的4V特性...
本笔记基于林子雨老师在MOOC上的《大数据技术原理》课程,旨在为IT从业者和大学生提供一个全面了解大数据的基础框架。 首先,我们要认识到大数据的发展背景。随着互联网的普及,以及物联网、社交媒体、移动设备等...
- 支持多种视图技术,如 JSP、FreeMarker、Velocity 等。 - 基于 Spring AOP 思想的拦截器机制,易于扩展和定制。 - 强大的输入校验功能。 **历史背景**: - **Struts1 vs. Struts2**: - **共同点**: 都遵循 MVC...