469,963 Members | 1,762 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,963 developers. It's quick & easy.

keep track of auto refresh in jsp page

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>&nbsp</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]
May 16 '08 #1
1 2828
Dököll
2,364 Expert 2GB
Pushing it forward:-)
Jun 12 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Alex Thomas | last post: by
3 posts views Thread by Scott | last post: by
3 posts views Thread by blu3g85 | last post: by
2 posts views Thread by MattB | last post: by
7 posts views Thread by Brian | last post: by
4 posts views Thread by jack-e | last post: by
3 posts views Thread by tinuananster | last post: by
2 posts views Thread by =?Utf-8?B?QW1pciBUb2hpZGk=?= | last post: by
1 post views Thread by rainxy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.