Solved

Update information in a JSP page

Posted on 2002-05-16
5
183 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Short answer to this question: there is no effective WiFi manager in iOS devices as seen in Windows WiFi or Macbook OSx WiFi management, but this article will try and provide some amicable solutions to better suite your needs.
A Short Story about the Best File Recovery Software – Acronis True Image 2017
This video discusses moving either the default database or any database to a new volume.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

760 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now