如何将spring checkbox标签转换为struts2复选框? [英] How to convert the spring checkbox tag to struts2 checkbox?
问题描述
我有一个问题,当转换spring复选框标记为struts ...
\\
我有复选框标签写在spring,我需要将其转换为struts使用值来从数据库到pojo的复选框将被启用和禁用根据..
\\
以下是在春天复选框的代码片段:
I have a problem while converting the spring check box tag to struts...
I have checkbox tag written in spring which i need to convert it into struts using the values coming from database into the pojo the check box shuld be enabled and disabled according to that..
Following is the code fragment on checkbox in spring:
<c:forEach var="menuList" items="${roleMenuActionMappingBean.menuList}" varStatus="status">
<form:checkbox path="menuList[${status.index}].active" id="a_${menuList.getMenuKey()}" value="${menuList.getMenuKey()}"/>
<form:hidden path="menuList[${status.index}].menuKey" value="${menuList.getMenuKey()}"/>
还有什么是: -
menuList[${status.index}]
<c:choose>
<c:when test="${menuList.getViewCheckBoxDisabled().equals('true')}">
<p><form:checkbox path="menuList[${status.index}].viewCheckBox" id="v_${menuList.getMenuKey()}" value="${menuList.getMenuKey()}"/></p>
</c:when>
<c:otherwise>
<p><form:checkbox path="menuList[${status.index}].viewCheckBox" id="v_${menuList.getMenuKey()}" value="${menuList.getMenuKey()}" disabled="true"/></p>
</c:otherwise>
</c:choose>
推荐答案
从 SpringMVC + JSTL )改为 Struts 2 :
-
-
Spring MVC复选框:
-
Spring MVC checkbox :
<form:checkbox/>
Struts 2核取方块:
Struts 2 checkbox :
<s:checkbox/>
-
Spring MVC的多个复选框:
Spring MVC multiple checkboxes :
<form:checkboxes/>
Struts 2多个复选框:
Struts 2 multiple checkboxes :
<s:checkboxList/>
-
JSTL forEach:
JSTL forEach :
<c:forEach>
Struts 2迭代器:
Struts 2 Iterator :
<s:iterator>
-
JSTL WHEN和OTHERWISE:
JSTL WHEN and OTHERWISE:
<c:when>
<!-- stuff -->
</c:when>
<c:otherwise>
<!-- stuff -->
</c:otherwise>
Struts 2 IF和ELSE:
Struts 2 IF and ELSE :
<s:if>
<!-- stuff -->
</s:if>
<s:else>
<!-- stuff -->
</s:else>
这篇关于如何将spring checkbox标签转换为struts2复选框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!