hi,
I have designed a jsp page. This jsp is able to auto refresh after 5 second.
But i want after 5th times of auto refreshment the table present inside the body should change.
Can anybody help me out.
My code is ::
<%@ page import = "example.*, java.util.*, javax.servlet.http.*" %>
<%! int i=0;
int cnt=0;
%>
[HTML]
<html>
<head>
<title> Info </title>
<meta http-equiv="refresh" content="5;url=index.jsp">
</head>
<%
cnt++;
%>
<body bgcolor='#0cd2ff' >
<table align='center' width='50%'>
<tr><td align='center'><font color='#af0002'size='8'><h1>xxxx</h1></font></td></tr>
<tr><td align='center'><br /></td></tr>
<tr><td align='center'><font color='#af0012'size='5'>Information</font></td></tr>
</table>
<% out.println(cnt); %>
<%!
BSInfoBean bsinfobean=null;
ArrayList infolist = null;
ArrayList bsinfo = null ;
ArrayList msinfo = null;
%>
<%
bsinfobean = new BSInfoBean();
infolist = (ArrayList) bsinfobean.retrieveRecord();
bsinfo = (ArrayList) infolist.get(0);
msinfo = (ArrayList) infolist.get(1);
//response.setHeader("Refresh", 60);
%>
<table bgcolor ="#feeab1" border="1" width= "75%" align='center' id = "bsinfotable">
<tr>
<td> </td>
<td align='center'><%=bsinfo.get(0) %> </td>
<td align='center'><%=bsinfo.get(1) %> </td>
<td align='center'><%=bsinfo.get(2) %> </td>
</tr>
<%
for(int i = 1; i<=cnt ; i++) {
%>
<tr>
<td align='center'>t<%= i %></td>
<td align='center'><%=msinfo.get(0) %> </td>
<td align='center'><%=msinfo.get(1) %> </td>
<td align='center'><%=msinfo.get(2) %> </td>
</tr>
<%
if( i == 5 ) {
break;
}
}
%>
</table>
</body>
</html>
[/HTML]