Solved

How to Refresh my Page if a cretain condition is MET

Posted on 2004-08-15
5
646 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

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

In the hope of saving someone else's sanity... About a year ago we bought a Cisco 1921 router with two ADSL/VDSL EHWIC cards to load balance local network traffic over the two broadband lines we have, but we couldn't get the routing to work consi…
A customer recently asked me about anti-malware and the different deployment options available for his business. Daily news about cyberattacks, zero-day vulnerabilities, and companies that suffered a security breach made him wonder if the endpoint a…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

863 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

23 Experts available now in Live!

Get 1:1 Help Now