JSP怎么表示如下代码

来源:百度知道 编辑:UC知道 时间:2024/06/01 17:05:18
<%
ArrayList showList = (ArrayList)session.getAttribute("showList");
if (showList != null)
{
int length = showList.size();
for(int i=0; i<length; i++)
{
CompanyXMLModel company = (CompanyXMLModel)showList.get(i);
%>
<tr align="center" valign="middle" bgcolor="<%=yy%>" onMouseOver="mOvr(this,'#FFECD9');" onMouseOut="mOut(this,'<%=yy%>');">
<%if rs.eof then
out.print("<td height=21></td>")
out.print("<td height=21></td>")
out.print("<td height=21></td>")
out.print("<td height=21></td>")
out.print("<td height=21></td>")
out.print("<td></td>")
else%>
&l

如果你的rs.eof为boolean型的值的话!
<%if (rs.eof){
out.print("<td height=21></td>")
out.print("<td height=21></td>")
out.print("<td height=21></td>")
out.print("<td height=21></td>")
out.print("<td height=21></td>")
out.print("<td></td>")
}else{%>
<td height="21" class="font" width="55" ><%=rs("zj")%></td>
<td class=tdsmall height=25 width=206><a href="<%=contextPath%>/sub_buy.jsp?id=<%=rs("id")%>" target="_blank" class="linkfont"><font color="#FF6600"><%=company.getName()%></font></a></td>
<td class=tdsmall height=25 width=189><%=company.getKind()%></td>
<td class=ttTable height=25 width=176><%=company