日期:2014-05-19  浏览次数:20645 次

struts标签
<%
List ziDuanList= (List)request.getAttribute("ziDuanList");
List fuhaoList= (List)request.getAttribute("fuhaoList");
List ziValueList= (List)request.getAttribute("ziValueList");
List cellList1= (List)request.getAttribute("cellList1");

for(int i=0;i<ziDuanList.size();i++){
Object obd =(Object)ziDuanList.get(i);
Object obh =(Object)fuhaoList.get(i);
Object obz =(Object)ziValueList.get(i);
 
String ziDuan1=obd.toString();
String fuHao1=obh.toString();
String zhi1=obz.toString();
%>

<select name="ziDuan">
<option value="">请选择=============<%=ziDuan1%></option>
<s:iterator value="cellList" id="cellList">
<s:if test="<%=ziDuan1%>== configField">
<option selected="selected" value="<s:property value='configField'/>+<s:property value='fieldType' />"><s:property value="CName" /></option>
</s:if>
<s:else>
<option value="<s:property value='configField'/>+<s:property value='fieldType' />"><s:property value="CName" /></option>
</s:else>
</s:iterator>
</select>

总是在s:if标签报错,不知道怎么个写法了...

------解决方案--------------------
1>把ziDuan1保存在session中.
<%
session.setAttribute("ziDuan1_key", ziDuan1);
%>
2>在Struts标签中.取session中的数据.
<s:if test="#session.session_key == configField">