简体   繁体   中英

Implement Reverse AJAX using DOJO javascript

I want to implement Reverse AJAX using DOJO javascript framework.

Does DOJO provide support out-of-the-box similar to others like DWR? I am using the latest DOJO. Any reference/examples would be great.

Also what changes would need to be done on the server-side ? I am using Java.

Well, there is the dojox/socket module which allows you to any WebSocket or Comet (= HTTP long polling) solution.

An alternative is the CometD project, this is a solution that uses long polling and allows you to communicate with Java applications (using the CometD Java library) and JavaScript applications (using the CometD Dojo library).

However, it is not out of the box with Dojo but is a separate project (the JavaScript lib was included in older versions though).


Your code setup will change, obviously. First you need to be able to run the CometD Java service, and then you can use ServerSession to publish data or ClientSession to subscribe at the Java side. Going into detail would be too broad, but you should probably read the reference guide .

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