Solved

Update information in a JSP page

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
With the rapid rise in mobile usage, mobile devices are here to stay and have become an integral part of doing business. Here are 9 great apps for your BYOD environment.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

895 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

11 Experts available now in Live!

Get 1:1 Help Now