Inigo Inigo - 4 months ago 21
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?


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);