关于<s:iterator>标签里用<s:if>标签的故事
<%Datedate=newDate();SimpleDateFormatsdf=newSimpleDateFormat("yyyy年MM月dd日");Stringstr...
<%
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
String str = sdf.format(date);
%>
<%=str%>
<s:iterator id="b" value="infos" status="st">
<tr>
<td align="center"><input type="checkbox" name="bilibili"
value="${b.id }" /></td>
<td align="left"><s:property value="#b.title" /></td>
<td align="left"><s:property value="#b.fnickname" /></td>
<td align="left"><s:property value="#b.time" /></td>
<td align="center">
<s:if test='#b.title==<%=str %>'>
<a href="modiNotesAction.action?id=<s:property value="#b.id" />">修改</a>
</s:if>
判断语句永远不成立,求解决
</td>
</tr>
</s:iterator> 展开
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
String str = sdf.format(date);
%>
<%=str%>
<s:iterator id="b" value="infos" status="st">
<tr>
<td align="center"><input type="checkbox" name="bilibili"
value="${b.id }" /></td>
<td align="left"><s:property value="#b.title" /></td>
<td align="left"><s:property value="#b.fnickname" /></td>
<td align="left"><s:property value="#b.time" /></td>
<td align="center">
<s:if test='#b.title==<%=str %>'>
<a href="modiNotesAction.action?id=<s:property value="#b.id" />">修改</a>
</s:if>
判断语句永远不成立,求解决
</td>
</tr>
</s:iterator> 展开
1个回答
2016-07-02
展开全部
您好,设置了var之后,试试用#获取
<s:iterator value="listUsers" var="u">
<dl>
<s:if test="#u.singerpic=='' || #u.singerpic==null">
<dd class="dd">
<a href="vote.action?userid=${u.id }">
<img src="images/ta.jpg" onclick="alert('投票成功!')"/> </a>
</dd>
</s:if>
</dl>
</s:iterator>
<s:iterator value="listUsers" var="u">
<dl>
<s:if test="#u.singerpic=='' || #u.singerpic==null">
<dd class="dd">
<a href="vote.action?userid=${u.id }">
<img src="images/ta.jpg" onclick="alert('投票成功!')"/> </a>
</dd>
</s:if>
</dl>
</s:iterator>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询