日期:2014-05-17  浏览次数:20628 次

struts2<s:if test=${pb.pageTotal>0}>出现问题 如果我这样写是正确的<s:if test=#request.pb.pageT
<s:if test="${pb.totalPage>0}">//这种写法有问题。
  <tr >
<td colspan="6" align="right" >
<table border="0">
<tr>
<td > </td>
<td align="center" ><a id="firstpage" href="#" style="cursor: hand">首页</a> 
<a id="lastpage" href="#" style="cursor: hand">上页</a> 
<a id="nextpage" href="#" style="cursor: hand">下页</a> 
<a id="endpage" href="#" style="cursor: hand">末页</a></td>
<td width="120px" align="center"" >
第<font id="currentpage" color="blue">${pb.currentPage}</font>页
共有<font id="totalrec" color="blue">${pb.totalPage}</font>记录
</td>
</tr>
</table>
</td>
</tr>
</s:if>
如下写法没有问题
<s:if test="#request.pb.totalPage>0">
  <tr >
<td colspan="6" align="right" >
<table border="0">
<tr>
<td > </td>
<td align="center" ><a id="firstpage" href="#" style="cursor: hand">首页</a> 
<a id="lastpage" href="#" style="cursor: hand">上页</a> 
<a id="nextpage" href="#" style="cursor: hand">下页</a> 
<a id="endpage" href="#" style="cursor: hand">末页</a></td>
<td width="120px" align="center"" >
第<font id="currentpage" color="blue">${pb.currentPage}</font>页
共有<font id="totalrec" color="blue">${pb.totalPage}</font>记录
</td>
</tr>
</table>
</td>
</tr>
</s:if>
谁能告诉我原因,为什么上一种是错误的。

------解决方案--------------------
struts2 的 标签 多半不 接收 表达式的${pb.totalPage>0} 就是一中表达式。
------解决方案--------------------
探讨
struts2 的 标签 多半不 接收 表达式的${pb.totalPage>0} 就是一中表达式。

------解决方案--------------------
Struts2-tag 不支持解析运行标签 s标签。
用jstl 就行,平常说的c标签