Prev: Portable Key Derivation from a password
Next: What is the difference between Memory Usage and Heap Usage in my JVM Metrics ?
From: albert kao on 8 Feb 2010 14:12 The goal is to refresh a JSP web page when a jms message is received or the Apache DB database is changed. How to do that with javascript or java? Is there any sample code?
From: Lew on 8 Feb 2010 14:17 albert kao wrote: > The goal is to refresh a JSP web page when a jms message is received > or the Apache DB database is changed. > How to do that with javascript or java? > Is there any sample code? Do you recall what Arne Vajhøj wrote when you asked that same question less than a week ago ("Dynamically refresh (update) JSP webpage when JMS notification is received")? >> True push: >> embed a Java applet for some Flash in the page >> >> Push simulated via long poll: >> write some JavaScript (AJAX style) How did that work for you? -- Lew
From: albert kao on 9 Feb 2010 11:18 On Feb 8, 2:17 pm, Lew <no...(a)lewscanon.com> wrote: > albert kao wrote: > > The goal is to refresh a JSP web page when a jms message is received > > or the Apache DB database is changed. > > How to do that with javascript or java? > > Is there any sample code? > > Do you recall what Arne Vajhøj wrote when you asked that same question less > than a week ago ("Dynamically refresh (update) JSP webpage when JMS > notification is received")? > > >> True push: > >> embed a Java applet for some Flash in the page > > >> Push simulated via long poll: > >> write some JavaScript (AJAX style) > > How did that work for you? > > -- > Lew I want to use Push simulated via long poll: write some JavaScript (AJAX style). How are this idea? On the server a file is created that holds a timestamp (for example). Pull that file from the web client every 10 secs or so. If it is changed, refresh the web page. Also, when a jms message is received or Apache DB database is changed, update that file on the server with the new timestamp in it.
From: Arne Vajhøj on 9 Feb 2010 21:18
On 09-02-2010 11:18, albert kao wrote: > I want to use Push simulated via long poll: write some JavaScript > (AJAX style). > How are this idea? > On the server a file is created that holds a timestamp (for example). > Pull that file from the web client every 10 secs or so. If it is > changed, > refresh the web page. > Also, when a jms message is received or Apache DB database is changed, > update that file on the server > with the new timestamp in it. That sounds awfully primitive. The servlet code processing your AJAX request should be able to return XML (or JSON) based on in memory data structures. Arne |