Solved

How to Refresh my Page if a cretain condition is MET

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
servlet init param and contect param 3 67
build fail in maven project 11 197
login jsp example 24 85
How  can  i  resolve  HTTP Status 404 -? 8 58
This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
Read our guide on how to survive being on-call.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

740 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