<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<s:hidden id="size" name="beanList.size()" />
<s:iterator var="bean" value="beanList" status="st">
<s:hidden name="beanList[%{#st.index}].id" />
<s:hidden id="flag_%{#st.index}" name="beanList[%{#st.index}].flag" />
<s:if test="#bean.isMust == 1">***</s:if>
<s:if test="%{#bean.showType == 'radio'}">**</s:if>
<s:iterator var="choice" value="#bean.choiceList" status="s">
<s:if test="choice == 'radio' ">**</s:if>
<div id="q_${st.index}">${st.index+1}</div>
<input id="bean_${st.index}" type="hidden" value="radio" />
</s:iterator>
<c:if test="${fn:contains(type, ',')}" >
<c:set var="idList" scope="request" value="${fn:split(id, ',')}" />
<c:set var="typeList" scope="request" value="${fn:split(type, ',')}" />
<c:forEach items="${idList}" var="idBean" varStatus="s1">
<c:forEach items="${typeList}" var="typeBean" varStatus="s2" >
<c:if test="${s1.index == s2.index}">
<c:choose>
<c:when test="${typeBean == 'pre'}">**</c:when>
<c:otherwise>**</c:otherwise>
</c:choose>
</c:if>
<c:forEach>
<c:forEach>
<%-- 循环展示Map --%>
<c:foreach items="${waitMap}" var="i">${i.key}:${i.value}</c:foreach>
本文深入探讨了Struts与JSTL标签库的集成应用,包括隐藏字段、迭代变量、条件判断等功能的实现方式。通过具体代码示例,详细解析了如何在JSP页面中利用这些标签库进行数据操作和展示。

被折叠的 条评论
为什么被折叠?



