I have created a list with result set values in which each column element is separated with :: and more than 50 rows using the java code given below.(arr1 is the array list and temp is a String)
int j=0;
while(resultSet11.next()){
temp=((++j)+"::"+resultSet11.getString("productname")+"::"+resultSet11.getString("exp")+"::"+resultSet11.getString("batch")+"::"+resultSet11.getString("qty")+"::"+resultSet11.getString("foc")+"::"+resultSet11.getString("mrp")+"::"+resultSet11.getString("rate")+"::"+resultSet11.getString("amount")+"::"+resultSet11.getString("taxper")+"::"+resultSet11.getString("taxamount")+"::"+resultSet11.getString("nettaxamount")+"::") ;
arr1.add(temp);
rowcount++;
bean.setFirstarray(1);
}
request.setAttribute("nextpagedetails", arr1);
Then I iterated this array list to get these values in a HTML table using the below code.
<table>
<s:iterator var="stat" value='#request.nextpagedetails' >
<tr>
<s:iterator status="arr" value="#stat.split('::')" var="des">
<td>
<s:property value="#des"/>
</td>
</s:iterator>
</tr>
</s:iterator>
</table>
But the problem is this iteration wont stop untill the values in the list ends. Since I am using this table in a print page, there is more than one page. So the second page is coming only after filling the entire portion of of the first page. Is there any way to limit the number of rows in a page using this method.
