473,549 Members | 2,784 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

keep track of auto refresh in jsp page

34 New Member
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.h ttp.*" %>

<%! 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='#0cd2f f' >
<table align='center' width='50%'>
<tr><td align='center'> <font color='#af0002' size='8'><h1>xx xx</h1></font></td></tr>
<tr><td align='center'> <br /></td></tr>
<tr><td align='center'> <font color='#af0012' size='5'>Inform ation</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.retr ieveRecord();
bsinfo = (ArrayList) infolist.get(0) ;
msinfo = (ArrayList) infolist.get(1) ;
//response.setHea der("Refresh", 60);
%>
<table bgcolor ="#feeab1" border="1" width= "75%" align='center' id = "bsinfotabl e">
<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 3015
Dököll
2,364 Recognized Expert Top Contributor
Pushing it forward:-)
Jun 12 '08 #2

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

Similar topics

3
3195
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 person later clicks the <back button> enough times they will arrive back at the page that processed the data the first time and the same data will...
3
12898
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 recordset table on the 2nd graph page and because the user gets to it by clicking the graph, the page doesn't properly post to render the recordset table....
3
487
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==---- http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
2
1799
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 that it's an aspx page it doesn't seem to refresh anymore. Is there an asp.net equivalent to this or some kind of adjustment I need to do to make it...
7
22678
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 be appreciated. Thanks, Brian
4
10017
by: jack-e | last post by:
How do I auto refresh a page a particular time of the day?
3
9355
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 html). When user clicks on a link from the left menu, i take the ID passed during the click and the page is redirected to a jsp that has information...
3
3574
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 where the table data is shown on webpage, that webpage need to be auto refresh. To make it more easy to understand
2
2907
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 TreeView, the page stops auto-refreshing. Any ideas why this is happening? I have acheived auto refresh using the following:
0
7518
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7956
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7808
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5368
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5087
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3498
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3480
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1935
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
757
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.