473,394 Members | 1,866 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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 3006
Dököll
2,364 Expert 2GB
Pushing it forward:-)
Jun 12 '08 #2

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

Similar topics

3
by: Alex Thomas | last post by:
This is my problem. I want to submit a form to another page to process the data from said form. Then the person can go on to another part of the site or another site altogether. However If the...
3
by: Scott | last post by:
I have a clickable graph that resides on page 1. If user clicks a data point on the graph, the page runs again yeilding a 2nd graph that shows a more detailed graph. Problem is, I have a...
3
by: blu3g85 | last post by:
how to redirect a page? as in after a few sec, the page will auto direct u to another page. ----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----...
2
by: MattB | last post by:
I have a page I've migrated from HTML to asp.net that would auto-refresh every 30 seconds. I did this by putting the following in the <head> section: <meta name="refresh" content="30"> But now...
7
by: Brian | last post by:
hello, I am looking for a way to auto refresh a web page that I created, but also let the user choose to stop the auto refresh. I can not figure out how to stop the auto refresh. Any help would...
4
by: jack-e | last post by:
How do I auto refresh a page a particular time of the day?
3
by: tinuananster | last post by:
Hi, I need to auto refresh a page after a specific time interval. When the page is accessed the first time, a request parameter is null and hence it gets redirected to a welcome page (static...
3
by: lezzo | last post by:
Hi Guys, I am new to this forum and find very interesting. I need your help in one of the script. I got a MySQL table bid_amount, and i want that if some new data comes in this table and...
2
by: =?Utf-8?B?QW1pciBUb2hpZGk=?= | last post by:
Hi I have a web page that has a TreeView on it. If I DONT'T expand the TreeView nodes, the auto refresh works nicely: my page gets refreshed every minute. As soon as I expand a node on the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.