Solved

Update information in a JSP page

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

IT certifications are a concrete representation of continual learning on the part of the candidate.  Continual learning is necessary for the long term success of an IT professional, but are IT certifications the right path for you?
The advancement in technology has been a great source of betterment and empowerment for the human race, Nevertheless, this is not to say that technology doesn’t have any problems. We are bombarded with constant distractions, whether as an overload o…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

856 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