请教各位,Struts标签的问题

04-05-31 hahafo
jsp中:

<logic:iterate id="port"name="PortList" >

<logic:equal name="port" property="portNo" value="aPortNo">

<td width="50"><bean:write name="port" property="portNo"/></td>

</logic:equal>

</logic:iterate>

action中

request.setAttribute("aPortNo", portNo);

portNo是个变量,但是标签中velue值应该是常量,

问:我怎么在Jsp中比较2个变量的值?(这个项目中不允许使用JSP语句,只允许用struts标签)

hahafo
2004-05-31 10:09
jsp中:
<logic:iterate id="port"name="PortList" >
<logic:equal name="port" property="portNo" value="aPortNo"> 
 <td width="50"><bean:write name="port" property="portNo"/></td>
</logic:equal>
</logic:iterate>
action中
 request.setAttribute("aPortNo", portNo);
<p>

portNo是个变量,但是标签中velue值应该是常量,

问:我怎么在Jsp中比较2个变量的值?(这个项目中不允许使用JSP语句,只允许用struts标签)

tooko
2004-06-03 13:38
用JSTL

c:forEach var="portList" items="${portList}"

c:if test="${aPortNo == portList.protNo}"

ifBody

/c:if

/c:forEach

(注:语句两边的括号我没加,要自己加上)

猜你喜欢