带 Restlet 的 GWT

发布于 2024-10-07 03:12:32 字数 210 浏览 0 评论 0原文

我在两个单独的 Web 应用程序中有一个 Restlet API 和一个 GWT Web 应用程序。我已将 Restlet GWT jar 添加到 GWT Web 应用程序,并为每个 API 服务器资源编写代理类。

我现在如何将两者联系起来?我需要将 servlet 添加到 web.xml 中吗?

这可能是一个初学者问题,我可能很愚蠢,但这是我的第一个 GWT 应用程序。

I have a Restlet API and a GWT web application in two seperate web applications. I have added the Restlet GWT jar to the GWT web application and written proxy classes for each of the API server resources.

How do I now link up the two? Do i need to add in a servlet into web.xml?

This is probably a beginner question and I might be being very silly but this is my first GWT app.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不一样的天空 2024-10-14 03:12:32

是的,您需要在 GWT 项目的 web.xml 中设置 Restlet Servlet。
然后,以调试模式启动 gwt 项目(这将启动 jetty servlet),您将可以访问 http:// /127.0.0.1:8888/YourServlet/...
您最终可以在另一台服务器上部署 Restlet Servlet。

最后使用 RequestBuilder 编写您的客户端服务。

请记住,如果您将 Restlet 服务部署在与您为 gwt 页面提供服务的主机不同的另一台主机上(例如,您的 Restlet 在 http://another_host:another_port/YourServlet)那么你将不得不处理SOP(http://en.wikipedia.org/wiki/Same_origin_policy)。

我建议您有不同的项目,一个用于服务器,另一个用于 gwt。第一个部署在 Server1 中,第二个由 Server2 提供服务。然后使用您需要在Server2中安装的http代理来处理SOP。

Yes, You need to setup your Restlet Servlet in the web.xml from your GWT project.
Then, start you gwt project in debug mode (that will launch the jetty servlet) and you will have acces to http://127.0.0.1:8888/YourServlet/...
You can eventually deploy the Restlet Servlet in another server.

Finally write your client services using RequestBuilder.

Have in mind that if you dispose your Restlet Services in another host different that the one where you serves you gwt pages (eg. your restlet is accesed in http://another_host:another_port/YourServlet) then you will have to deal with SOP (http://en.wikipedia.org/wiki/Same_origin_policy).

I recommend you to have different projects one for the server and another for the gwt. The first deployed in Server1 and the second served by Server2. And then deal with SOP using a http proxy which you need to install in Server2.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文