Solved

Update information in a JSP page

Posted on 2002-05-16
5
185 Views
Last Modified: 2010-05-18
I want periodically update the information in a table on a jsp page by calling an method. Is there a timer in JSP to help this?
0
Comment
Question by:pzhang
5 Comments
 
LVL 1

Expert Comment

by:raid999
ID: 7015296
Mate there is a class called Timer have alook at this
http://java.sun.com/j2se/1.3/docs/api/java/util/Timer.html
and this is really good too.
http://www.javaworld.com/javaworld/javatips/jw-javatip125.html
0
 
LVL 19

Accepted Solution

by:
cheekycj earned 25 total points
ID: 7018836
for JSP to update a table automatically you have two options (I believe)

use a javascript timer and dynamcially update the table using DHTML.

or use meta refresh header tag.

CJ
0
 

Assisted Solution

by:mark_at_serialmonkey
mark_at_serialmonkey earned 25 total points
ID: 7038336
There are a couple of options.

1. Use a Javascript timer and refresh the whole page.
2. Use a META-Refresh tag
3. Use a Javascript timer and a hidden frame and update using DHTML.

The first two are good for largish refresh times (20sec, 30sec for example) and if all the data is on the screen at once (i.e. you have no scroll bar).

The last one is a must for small refresh times and scrolling because the first two options reload the whole page and such scroll the user back to the top of the page. Very annoying if the user is scrolled half way down and it keeps refreshing and sending them to the top.

The third one is using a hidden frame to constantly refresh using a Javascript timer. Each time it refreshes it checks to see if the page is loaded and then updates the table using DHTML. You have to be careful with DHTML as most of the solutions only work in Internet Explorer and there are retrictions on how tables work with DHTML.

A good site on how to use DHTML in IE is
http://msdn.microsoft.com/workshop/author/dyncontent/content.asp?frame=true
0
 
LVL 19

Expert Comment

by:Kuldeepchaturvedi
ID: 9553795
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

"split between cheekycj  and mark_at_serialmonkey."
 
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Kuldeepchaturvedi
EE Cleanup Volunteer
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Help with LDAp login using jsp 6 113
java cyclic graphs 15 208
stateless EJB with glassfish 2 73
mysql jsp example issue 32 33
One of the biggest threats in the cyber realm pertains to advanced persistent threats (APTs). This paper is a compare and contrast of Russian and Chinese APT's.
This article outlines the process to identify and resolve account lockout in an Active Directory environment.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question