日期:2014-05-18  浏览次数:20858 次

关于用JSP做权限判断的问题
我用的是上海普元开发的EOS平台做的BBS
有一段是这样的:
<%
int   count=0;
String   trClass= "result_content ";
%>

<logic:iterate   id= "ResultSet "   property= "list[@type= 'calling '] ">
<%
if(count%2==0)
trClass= "result_content ";
else
trClass= "result_content_ ";
count++;
if(( <bean:write   property= "DB_MPH/SFGY "/> ).equals( "1 "))
%>
<tr   class= " <%=trClass   %> ">
<td>
<bean:write   id= "ResultSet "   property= "DB_MPH/MAINID "/>
</td>
<td>
<a   href= "javascript:kecheng( <bean:write   id= 'ResultSet '   property= 'DB_MPH/MAINID '/> ); ">
<bean:write   id= "ResultSet "   property= "DB_MPH/XM "/>
</a>
</td>
<td>
<bean:write   id= "ResultSet "   property= "DB_MPH/SYH "/>
</td>
<td>
<bean:write   id= "ResultSet "   property= "DB_MPH/XB "/>
</td>
<td>
<bean:write   id= "ResultSet "   property= "DB_MPH/DWMC "/>
</td>
<td>
<bean:write   id= "ResultSet "   property= "DB_MPH/TXDZ "/>
</td>
<td>
<bean:write   id= "ResultSet "   property= "DB_MPH/DHHM "/>
</td>
</tr>
</logic:iterate>  

<logic:iterate> </logic:iterate> 是循环输出数据库中寻找到的数据
<bean:write   property= ".... "> 是输出一条数据
我想判断数据库中得到 <bean:write   property= 'DB_MPH/MAINID '/> 这个字段,如果为 "1 "就显示,不为一就跳过寻找下一条数据记录.
我这样写是对的吗??

------解决方案--------------------
为什么不用 <logic:equal name= "要比较的bean " value= "1 "> 显示内容 </logic:equal> 这个标签?