Please help me in doing this
[nobr]hi,
I'm new for the JSP and got struck at this point .
I have a JSP page wherein it consists of a table and the servlet that retrieves the data from the DB(MY SQL). Now i need to fill the contents of the table as mentioned below.
First 5 rows must get printed then upon clicking the next button the next five rows must be filled.....and so on......
Please help me in reaching this requirement.
JSP CODE:
<%@ page import="java.io.*" %>
<%@ page import="java.lang.*" %>
<%@ page import="java.util.*" %>
<html>
<head><title> TOP USERS </title>
</head>
<body bgcolor="c0c0c0">
<div align="center">
<table>
<tr bgcolor="white"><td> <font color="red" size="5"><b>TOP USERS </b> </font></td></tr>
</table>
</div>
<div align="center">
<form name="top">
<font face="verdana">
Reportfor TOP
<select name="users">
<option value="5">5
<option value="10">10
<option value="15">15
</select>
Users
<br> <br>
<% ArrayList list=new ArrayList();
list=(ArrayList)request.getAttribute("TOPUSERS");
%>
<table border="1" align="center" width=35%>
<tr>
<td align="center"><b> Name </b> </td>
<td align="center"> <b> Phone # </b> </td>
</tr>
<%
int cnt=10;
if(cnt!=0)
{
for(int i=0; i<cnt; i++)
{
%>
<tr>
<td align="left"> <% out.println(list.get(i));
i++; %>
</td>
<td align="right"> <% out.println(list.get(i));%>
</td>
</tr>
<%}
} %>
</table>
<table border="0" align="center" width=35% >
<tr><td align="right"> <input type="submit" value="next" name="next" onclick="return cnt+=10"> </td> </tr>
</table>
</font>
</form>
</div>
</body>
</html>
Please correct the above code......
sorry if my code is wrong........
Here i can print the all the rows at once but i'm not able to pring in 5 rows and upon the clik of next the next five rows........[/nobr]

