freemarker 标签

场景:

struts2 <s:if></s:if>标签与freemarker<#if></#if>判断设置radio框的checked属性
test.jsp页面

<input type="radio <s:if test="combination.timebound==0">checked</s:if> value="1"/>一年
<input type="radio" <s:if test="combination.timebound==1">checked</s:if>value="3"/>三年

其用法和freemarker<#if></#if>类似:下面是test.ftl页面写法

<input type="radio" <#if combination.timebound==0>checked</#if> value="1">一年
<input type="radio" <#if combination.timebound==1>checked</#if> value="3">三年