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

<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>

只显示第一行表格 ,第二第三行不显示。

慕容7724642
浏览 1555回答 2
2回答

weenhall

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

han_leirong

跟在平常的jsp中一样,获取到table这个元素,在控制它只显示第一个(用JavaScript,或者jQuery。后者简单点)。
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java