admin管理员组文章数量:1414614
Intro: I want to develop simple multiplayer Five in row (Gomoku). Front-end should be done using JavaScript, and back-end in Java.
Basically client and server should exchange pairs of integer numbers and game id. It's easy to do on client side with WebSockets, but...
Question: Is there simple way to process munication on server side, using Sockets and ServerSocket, without embedding Jetty or any other server?
Intro: I want to develop simple multiplayer Five in row (Gomoku). Front-end should be done using JavaScript, and back-end in Java.
Basically client and server should exchange pairs of integer numbers and game id. It's easy to do on client side with WebSockets, but...
Question: Is there simple way to process munication on server side, using Sockets and ServerSocket, without embedding Jetty or any other server?
Share Improve this question edited Feb 14, 2012 at 19:46 Peter Svensson 6,1731 gold badge34 silver badges31 bronze badges asked Feb 8, 2012 at 9:00 VillerViller 5305 silver badges19 bronze badges3 Answers
Reset to default 3Since Front-end is javascript it might run in a web browser. To municate with the server most likely using http, then embedding Jetty and using dwr is the simplest way IMO.
If you intend to do such thing on a web project, have a look at the DWR project.
WebSockets browser support is poor at the moment.
If you're creating a Web application the mainstream solution for JS-Java munication is Ajax with some JS framework like jQuery or Dojo. It will not require any libs on the server side (unlike DWR) and also you don't need to put any JS stuff on your server if you use CDN.
本文标签: Looking for simple way of communication between JavaScript and JavaStack Overflow
版权声明:本文标题:Looking for simple way of communication between JavaScript and Java - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745181862a2646501.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论