Inigo Inigo -5 years ago 125
Java Question

How to send an alert/alarm in a jsp on sql insert

When customer makes a deposit, this inserts a request in the database. When this happens, I want send an alert or play an alarm on a separate jsp (admin page containing list of approvals). Any ideas?

Answer Source

In case anyone is interested, I solved this by creating a polling function that runs on the header that sits on all pages via tiles framework.

var alert = document.createElement('audio');
var count2 = $.cookie('list');
function poll(){
        url: url
        ,type: "GET"
        ,success: function(data){
            var count1 =;
                count2 = count1;
            }else if(count1<count2){
                count2 = count1;
        ,dataType: "json"
        ,complete: poll
        ,timeout: 2000
}, 30000);


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download