[英]Connecting Google App Engine with Javascript client
I have a diagram editor application (client), which is written in javascript. 我有一个用JavaScript编写的图表编辑器应用程序(客户端)。 I need to take the model of the diagrams (can be transformed to text), and synchronise it with my GAE Java application which will be my backend.
我需要获取图表模型(可以转换为文本),并将其与我的GAE Java应用程序(将其作为后端)进行同步。 The application will then store this model on cloud, or send it to other clients.
然后,应用程序将将此模型存储在云中,或将其发送给其他客户端。 (as a result many people work on same diagrams)
(因此,许多人使用相同的图)
This is a totally new field to me, and even though I completed some of the tutorials google provides, and gone through documentation, I am not sure how the connection will be done (tutorials used JSP). 对我来说,这是一个全新的领域,即使我完成了google提供的一些教程并浏览了文档,但我不确定如何完成连接(教程使用JSP)。
What is the most straight- forward approach into connecting a Java application (GAE) with a JS client ?
将Java应用程序(GAE)与JS客户端连接的最直接的方法是什么?
ps: I have read about ajax, but I dont know if its the right solution for this, or if there is a better one. ps:我已经读过有关ajax的文章,但是我不知道它是否适合此解决方案,或者是否有更好的解决方案。
What is the most straight- forward approach into connecting a Java application (GAE) with a JS client ?
将Java应用程序(GAE)与JS客户端连接的最直接的方法是什么?
Through an API built on HTTP. 通过基于HTTP的API。 Your JAVA web app can expose certain endpoints.
您的JAVA Web应用程序可以公开某些终结点。 You can then use Javascript to make http requests, (through AJAX) to your java web api).
然后,您可以使用Javascript(通过AJAX)向Java Web API发出http请求)。 This is currently the defacto way of communicating from front end with javascript to any backend service.
当前,这是从前端使用javascript到任何后端服务进行通信的事实上的方法。
There will be some trickiness to supporting real time collaboration between clients. 支持客户端之间的实时协作将有些棘手。
Additionally, there has been increasing support for websockets , which allows you to open a persistant connection between your client and your server, i don't know if java on GAE supports it though... 此外,对websockets的支持越来越多,这使您可以在客户端和服务器之间打开持久连接,但我不知道GAE上的Java是否支持它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.