This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Global notification method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Global notification method" Watch "Global notification method" New topic
Author

Global notification method

Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3479

Hey,
I'm doing a Grails application, this application is for sending bulk SMSs.
Sending SMS doesn't happening immediately, a JMS message is sent to MOM and a listener then does the dirty work.
So the user clicks on the button (via Ajax), he gets an info message and he is free to use the rest of the application.
I want to show him a global notification info label when the JMS listener is done with sending.
Do you suggest a way to do this?
If it isn't practical, do you know a better way?
(Sorry if this is not the right forum to ask).
Thanks for help and time.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Well the server can not push data back to the client so the client has to keep asking for it. So you either ping the server on regular intervals, or you use COMET.

Eric
Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3479

Ajax Comet is something new to me.
Do you know an easy to read article about it?
I'm using Prototype, is it possible to comet with Prototype?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
In your case COMET is probably overkill.

All COMET is is making an Ajax call to the server, and the server holds it open until it needs to send data back. Most places can not handle that many open connections at one time.

Just send up a ping to the server asking if it has anything new.

Eric
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

In our app we're doing something similar (not SMS) but we're sending messages to a JMS queue and our app just sends an ajax request to the server to check the status of things, periodically. I looked into COMET and ran away.


GenRocket - Experts at Building Test Data
 
Don't get me started about those stupid light bulbs.
 
subject: Global notification method