Beetl 3.0.11 release, Java template engine

This release increases in accordance with the requirements of the community adds some similar JSTL tag function, built-in following html tags

TAG.html.include= org.beetl.ext.tag.html.IncludeResourceHtmlTag
TAG.html.layout= org.beetl.ext.tag.html.LayoutResourceHtmlTag
TAG.html.set= org.beetl.ext.tag.html.SetHtmlTag
TAG.html.if= org.beetl.ext.tag.html.IfHtmlTag
TAG.html.foreach= org.beetl.ext.tag.html.ForeachHtmlTag

The following example   

<#html:include file="" arg1="" arg2="" />

include a name attribute contains the file template path, behind a number of optional attributes, is referenced in the sub-template

<#html:layout  parent="" args1  arg2="">
    .......  
</#html:layout>

The same label layout function, you must include the parent, specify the layout template path

html: set, use export to set a variable name, after that you can use this variable name to refer to this variable (difference between export and var, the variable declared the former can be used later template, but var can only be used in the tag body)   

<#html:set value="${usere.age+1}" export="age"/>

html: if, comprising a test for whether the test condition is true, if true, execution tag body

<#html:if test="${condtion}">
.....
</#html:if>

html: foreach, declare variables to cycle through the items by name var stated circulation element, it can declare a state, and for this cycle, is a target ILoopStatus

<#html:foreach items="${xxx}" var="item">
${item}
</#html:foreach>
    
<#html:foreach items="${xxx}" var="item,status">
${status.index}--${item} 
</#html:foreach>

Maven

<dependency>
        <groupId>com.ibeetl</groupId>
        <artifactId>beetl</artifactId>
        <version>3.0.11.RELEASE</version>
</dependency>

Beetl online experience  http://ibeetl.com/beetlonline/  

Beetl template (text processing) engine fully functional, excellent experience, with many innovative features and implementation. Is the world's fastest template engine running, since JDK6, there are some new generation template engine was born, Beetl performance is still king, as a result of JMH can test from  template-benchmark

 

Guess you like

Origin www.oschina.net/news/109122/beetl-3-0-11-released