---
title: "jetbrick-template 1.1.1 发布，增强 layout 功能"
author: "subchen"
date: "2013-12-09T09:02:26Z"
tags: []
categories: ["企业架构"]
slug: "jetbrick-template-1-1-1-layout"
draft: false
lastmod: "2013-12-09T09:04:35Z"
id: 1986925
url: "https://subchen.iteye.com/blog/1986925"
---

全面超越 Velocity 的全新一代 Java 模板引擎 jetbrick-template 1.1.1 正式版发布。  
新版增强了 layout 功能，并修复大量 bug。  

```
#tag block("bodyContent1")
    BODY 1111
#end
#tag block("bodyContent2")
    BODY 2222
#end
#include ("layout.jetx")
```

  

完善的中文在线文档：[http://subchen.github.io/jetbrick-template/](http://subchen.github.io/jetbrick-template/)

 

**Version 1.1.1 (2013-12-08)**

- \[新增] [#28 增强 asDefault() 方法扩展，支持设置默认值](https://github.com/subchen/jetbrick-template/issues/28)
- \[新增] [#30 增强 #put，一次支持多个变量的传递](https://github.com/subchen/jetbrick-template/issues/30)
- \[新增] [#31 增加 Spring FactoryBean 的集成支持](https://github.com/subchen/jetbrick-template/issues/31)
- \[新增] [#35 增加 #tag block(name) 默认实现，配合 #include 实现多个内容块的 layout](https://github.com/subchen/jetbrick-template/issues/35)
- \[增强] [#39 增强 #tag layout 功能，允许添加自定义参数给 layout 模板](https://github.com/subchen/jetbrick-template/issues/39)
- \[修复] [#20 The column of error line is wrong when the line contains '\\t'](https://github.com/subchen/jetbrick-template/issues/20)
- \[修复] [#24 三元表达式如果使用 Interface 或者 Primitive Class 作为选项，会出现 NullPointerException](https://github.com/subchen/jetbrick-template/issues/24)
- \[修复] [#25 #if #else #end 语句后面貌似丢了一个换行](https://github.com/subchen/jetbrick-template/issues/25)
- \[修复] [#27 #set指令创建double型字面变量时，小数点后面跟0则不能通过编译](https://github.com/subchen/jetbrick-template/issues/27)
- \[修复] [#29 如果没有 #if 只有独立的 #else 或者 #end，没有报错，且剩余内容会被省略掉](https://github.com/subchen/jetbrick-template/issues/29)
- \[修复] [#33 属性安全调用问题？](https://github.com/subchen/jetbrick-template/issues/33)
- \[修复] [#34 拼写错误: #tag layout 中的实现用的是 bodyContext, 文档中描述的是 bodyContent，不一致](https://github.com/subchen/jetbrick-template/issues/34)
- \[修复] [#37 throw NullPointerException when method parameter is null.](https://github.com/subchen/jetbrick-template/issues/37)
- \[修复] [#40 #form 和 #for 指令冲突，编译失败](https://github.com/subchen/jetbrick-template/issues/40)
- \[修复] [#41 从 request uri 中获取模板路径存在问题，会出现404错误](https://github.com/subchen/jetbrick-template/issues/41)
- \[修复] [#42 include() 函数和 #tag layout() 传的 Map 参数出现编译错误](https://github.com/subchen/jetbrick-template/issues/42)

jetbrick-template 是一个新一代 Java 模板引擎，具有高性能和高扩展性。 适合于动态 HTML 页面输出或者代码生成，可替代 JSP 页面或者 Velocity 等模板。 指令和 Velocity 相似，表达式和 Java 保持一致，易学易用。

- 支持类似与 Velocity 的多种指令
- 支持静态编译
- 支持编译缓存
- 支持热加载
- 支持类型推导
- 支持泛型
- 支持可变参数方法调用
- 支持方法重载
- 支持类似于 Groovy 的方法扩展
- 支持函数扩展
- 支持自定义标签 #tag
- 支持宏定义 #macro
- 支持布局 Layout