简体   繁体   中英

What are the best options for a Java/jQuery polling interface?

I am building an application in Java (with a jQuery frontend) that needs to talk to a third party application. it needs to update the interface every two seconds at the most.

Would it be a good idea to use comets? If so, how do they fit into the picture?

What other means/technologies can I use to make the application better?

Have you looked at DWR ( http://directwebremoting.org/dwr/index.html )? It provides a fairly nice interface between Java and Javascript and supports Comet. I believe it even lets you target data pushes based on a number of criteria, eg this user or these users on this page. It can also automatically adjust pooling times (if you go this route).

I would also recommend checking out ExtJS http://extjs.com/deploy/dev/examples/samples.html if you intend on making this more of an application then a webpage (like a blog or whatever). I am uncertain if they have any kind of Comet support built in (I don't think so), but you could easily make an adapter that kept one of their data sources up-to-date with push data. Their components, especially the grids, are top notch.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM