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

han_leirong
TA貢獻(xiàn)1條經(jīng)驗 獲得超0個贊
跟在平常的jsp中一樣,獲取到table這個元素,在控制它只顯示第一個(用JavaScript,或者jQuery。后者簡單點)。
添加回答
舉報
0/150
提交
取消