改模板,也就是checkboxlist.ftl文件<#assign itemCount = 0/>
<#if parameters.list?exists>
<@s.iterator value="parameters.list">
<#assign itemCount = itemCount + 1/>
<#if parameters.listKey?exists>
<#assign itemKey = stack.findValue(parameters.listKey)/>
<#else>
<#assign itemKey = stack.findValue('top')/>
</#if>
<#if parameters.listValue?exists>
<#assign itemValue = stack.findString(parameters.listValue)/>
<#else>
<#assign itemValue = stack.findString('top')/>
</#if>
<#assign itemKeyStr=itemKey.toString() />
<tr>
<td width="5%">
<input type="checkbox" name="${parameters.name?html}" value="${itemKeyStr?html}" id="${parameters.name?html}-${itemCount}"<#rt/>
<#if tag.contains(parameters.nameValue, itemKey)>
checked="checked"<#rt/>
</#if>
<#if parameters.disabled?default(false)>
disabled="disabled"<#rt/>
</#if>
<#if parameters.title?exists>
title="${parameters.title?html}"<#rt/>
</#if>
<#include "/${parameters.templateDir}/simple/scripting-events.ftl" />
<#include "/${parameters.templateDir}/simple/common-attributes.ftl" />
/>
</td>
<td width="95%">
<label for="${parameters.name?html}-${itemCount}" class="checkboxLabel">${itemValue?html}</label>
</td>
</tr>
</@s.iterator>
<#else>
</#if>
<#if parameters.list?exists>
<@s.iterator value="parameters.list">
<#assign itemCount = itemCount + 1/>
<#if parameters.listKey?exists>
<#assign itemKey = stack.findValue(parameters.listKey)/>
<#else>
<#assign itemKey = stack.findValue('top')/>
</#if>
<#if parameters.listValue?exists>
<#assign itemValue = stack.findString(parameters.listValue)/>
<#else>
<#assign itemValue = stack.findString('top')/>
</#if>
<#assign itemKeyStr=itemKey.toString() />
<tr>
<td width="5%">
<input type="checkbox" name="${parameters.name?html}" value="${itemKeyStr?html}" id="${parameters.name?html}-${itemCount}"<#rt/>
<#if tag.contains(parameters.nameValue, itemKey)>
checked="checked"<#rt/>
</#if>
<#if parameters.disabled?default(false)>
disabled="disabled"<#rt/>
</#if>
<#if parameters.title?exists>
title="${parameters.title?html}"<#rt/>
</#if>
<#include "/${parameters.templateDir}/simple/scripting-events.ftl" />
<#include "/${parameters.templateDir}/simple/common-attributes.ftl" />
/>
</td>
<td width="95%">
<label for="${parameters.name?html}-${itemCount}" class="checkboxLabel">${itemValue?html}</label>
</td>
</tr>
</@s.iterator>
<#else>
</#if>
解决方案 »
- 【求救】eclipse下报错,myeclipse下没报错,什么情况
- java操作word表格模板
- 请教一个hibernate的保存一对多实例的问题。
- 严重: Exception starting filter struts2!!!!高手指点
- 求学习SSH的经典参考书
- 在hibernate中,怎么设置取数据库的时间
- 一个可以正常运行的工程,在MyEclipse中重新编译后就不能运行了
- 我的开发工具时weblogic8.x+jbuilder x,我编译程序时就出现java.lang.StringIndexOutofBoundsException的错误,急!!!
- 怎么修改config.xml以把ejb发布到WEBLOGIC6上?(特请芳芳与天妒英才高手解答)
- 用JNDI日常出错,求解答
- Struts2中<result name="input>的配置
- rmi中,服务器如何向客户端发信息
在Action用List保存List的方法,在页面用<s:iterator>来遍历List,可以嵌套多层,这样就可以表格形式的输出了,无论横行还是竖行都可以
我已经使用成功了