为了账号安全,请及时绑定邮箱和手机立即绑定

jsp中Java语句内的表格不显示

jsp中Java语句内的表格不显示

慕容7724642 2016-09-08 15:13:53
<body> 在线用户表 <table width="403" border="1"  bordercolor="#000000">   <tr>     <th width="52" scope="col">序号</th>     <th width="77" height="30" scope="col">用户名</th>     <th width="73" scope="col">IP地址</th>     <th width="76" scope="col">访问时间</th>     <th width="103" scope="col">来自得url</th>   </tr> <%     @SuppressWarnings("unchecked")     HashMap<String,Visitor> map=(HashMap<String,Visitor>)application.getAttribute("ONLINE");     Set<String> ids=map.keySet();     Iterator<String> it=ids.iterator();     int i=3;     while(it.hasNext())     {        String id=it.next();        Visitor v=map.get(id);       i++;         %>      <tr>     <td><% out.print(i); %>002</td>     <td><%  out.print(v.getIp());%></td>     <td><% %></td>     <td><% %></td>     <td><% %></td>      </tr>     <tr>     <td>0</td>     <td>1</td>     <td>2</td>     <td>3</td>     <td>4</td>      </tr>   <%    }      %>        </table> </body> </html>只显示第一行表格 ,第二第三行不显示。
查看完整描述

2 回答

?
weenhall

TA贡献121条经验 获得超57个赞

那说明没取到值,用f12在浏览器调试一下

查看完整回答
反对 回复 2016-09-08
?
han_leirong

TA贡献1条经验 获得超0个赞

跟在平常的jsp中一样,获取到table这个元素,在控制它只显示第一个(用JavaScript,或者jQuery。后者简单点)。

查看完整回答
反对 回复 2016-09-08
  • 2 回答
  • 0 关注
  • 1554 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信