?
Solved

How to Refresh my Page if a cretain condition is MET

Posted on 2004-08-15
5
Medium Priority
?
670 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
3 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 100 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 28

Assisted Solution

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

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

rrz
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

This shares a stored procedure to retrieve permissions for a given user on the current database or across all databases on a server.
Applications for our next round of the Experts Exchange Scholarship Contest are starting to roll in. It made us wonder what our past winners are up to these days. Here's a look at what four winners experienced with the contest and what they're doing…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

850 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