| 程序包 | 说明 |
|---|---|
| org.beetl.core | |
| org.beetl.core.statement | |
| org.beetl.core.tag | |
| org.beetl.ext.fn | |
| org.beetl.ext.jsp | |
| org.beetl.ext.spring | |
| org.beetl.ext.tag | |
| org.beetl.ext.tag.cache | |
| org.beetl.ext.tag.html |
| 限定符和类型 | 方法和说明 |
|---|---|
Tag |
DefaultTagFactory.createTag() |
Tag |
Context.getCurrentTag() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
Context.setCurrentTag(Tag tag) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
TagStatement.runTag(Tag tag,
Context ctx) |
protected void |
TagVarBindingStatement.runTag(Tag tag,
Context ctx) |
| 限定符和类型 | 类和说明 |
|---|---|
class |
GeneralVarTagBinding
此类子类将可以作为html 标签使用,除了能实现bindVars来初始化绑定的变量外,允许render方法里通过调用
方法bind(name,value) 来绑定变量,或者更常用的是binds(Object... array)如下是一个例子
public class TestGeneralVarTagBinding extends GeneralVarTagBinding
{
public void render()
{
for (int i = 0; i < 5; i++)
{
this.bind("value", i);// or this.binds(i);
this.doBodyRender();
}
}
}
此例子会循环渲染标签体5次,并且每次循环都会设置value的值,如下是模板内容
<#tag ; value>
${value}
</#tag>
|
class |
HTMLTagSupportWrapper
封装了html 标签调用,转为Beetl转为真正的
Tag 执行 |
class |
HTMLTagVarBindingWrapper
GeneralVarTagBinding 的html标签封装,带变量绑定的html标签调用的标签 |
| 限定符和类型 | 字段和说明 |
|---|---|
protected Tag |
Tag.parent |
| 限定符和类型 | 方法和说明 |
|---|---|
Tag |
TagFactory.createTag()
创建一个标签
|
Tag |
Tag.getParent() |
| 限定符和类型 | 方法和说明 |
|---|---|
Tag |
ParentTagFunction.call(Object[] paras,
Context ctx) |
| 限定符和类型 | 类和说明 |
|---|---|
class |
IncludeJSPTag |
| 限定符和类型 | 方法和说明 |
|---|---|
Tag |
SpringBeanTagFactory.createTag()
返回上下文中对应Tag bean对象
|
| 限定符和类型 | 类和说明 |
|---|---|
class |
DeleteTag
什么都不干的tag,遗留代码
|
class |
IncludeFragmentTag
包含模板的一部分内容,类似ajax渲染
<%
includeFragment("/layout.btl","c1"){}
%>
//layout.btl
<%
#fragment c1:{
print("ok c1" +1/0);
}
%>
<%
#fragment c2:{
print("ok c2");
}
%>
|
class |
IncludeTag |
class |
IncludeUrlTag
includeUrl("/user/id/1")
Created by yangyuanshuai on 15:21.
|
class |
LayoutTag
提供一个布局功能,每个页面总是由一定布局,如页面头,菜单,页面脚,以及正文 layout标签允许为正文指定一个布局,如下使用方式
content.html内容如下:
<%layout("/org/bee/tl/samples/layout.html"){%>
this is 正文
..........
|
class |
TrimHtml |
| 限定符和类型 | 类和说明 |
|---|---|
class |
CacheTag
cache标签,模板页面可以通过cache标签缓存模板内容
#: cache(key,timeout,refresh)
模板内容
#:}
beetl将会把key值对应的模板内容放到cacheManger,下次访问时候,如果key值对应的模板内容在,就直接输出,而
不需要再次解析运行模板。
|
| 限定符和类型 | 类和说明 |
|---|---|
class |
ForeachHtmlTag
|
class |
IfHtmlTag
一个html标签方式的tag,同includeTag
|
class |
IncludeResourceFragmentHtmlTag
一个html标签方式的tag,同includeTag
<#html:includeFragment file="" fragment="" arg1="" arg2=""/>
|
class |
IncludeResourceHtmlTag
一个html标签方式的tag,同includeTag
<#html:include file="" arg1="" arg2=""/>
|
class |
LayoutResourceHtmlTag
同layoutTag,采用html方式布局
<#html:layout parent="" attr1="" attr2="">
#html:layout>
|
class |
SetHtmlTag
<#html:set value="${user.name}" export="name" >#html:set>
|
Copyright © 2022. All rights reserved.