首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2EE开发 >

struts标签,该怎么处理

2012-11-11 
struts标签% List ziDuanList (List)request.getAttribute(ziDuanList)List fuhaoList (List)reques

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">

热点排行