Solved

How to Refresh my Page if a cretain condition is MET

Posted on 2004-08-15
5
640 Views
Last Modified: 2008-02-01
hello JSP wizards,
                         I am a novice web programmer, doing my college project in JSP. Before i explain my Problem. I need to refresh My page if a certain condition is Met. How do i do this.. The page should be refreshd automatically when this contition is met. This condition is not time dependant. If it were then i would have used the < meta tag> and specified the refresh duratino in seconds. But here i am actually reading records from a database upon the click of a Button and if a particular colum's data matches certain condition i need to forcefully refresh my page without the user having to click the REFRESH Button of the browser..
                      How do i do this ? Pls guide Me

Thanx
novice JSP programmer.
0
Comment
Question by:FearFactor_x
5 Comments
 
LVL 3

Expert Comment

by:pulupul
ID: 11803617
Could you give more details?. HTTP is one-direction. I mean, the client can ask the server to send the page again, but once the page is loaded and the connection closed, the server (where the JSPs are executed) cannot contact the client in any way.
In your case maybe JavaScript could do the job, as with JS you can force refresh of the page from the client, but depends on the details of your case. However is not good to depend much on JavaScript.
0
 
LVL 3

Accepted Solution

by:
sbockelman earned 25 total points
ID: 11803978
use JavaScript

something like ...

onclick="doHandleChange(this);"

function doHandleChange( obj ) {

// if obj's new value matches some condition, load a new page

location.replace( <url with params to new page view >, true );

}
0
 
LVL 27

Assisted Solution

by:rrz
rrz earned 25 total points
ID: 11804200
In your db page, you could use  

if(condition_is_Met){
                              response.sendRedirect(request.getHeader("referer"));
}

rrz
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Moving applications to the cloud or switching services to cloud-based ones, is a stressful job.  Here's how you can make it easier.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video discusses moving either the default database or any database to a new volume.

746 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

12 Experts available now in Live!

Get 1:1 Help Now