Restlet 与 Spring MVC 的 Restful Web 服务

发布于 2024-08-29 13:07:00 字数 491 浏览 3 评论 0原文

我正在研究如何最好地在 Google 应用引擎上创建 Restful Web 服务。我的最终目标是让 Android 应用程序调用 GAE 上的 Web 服务来发布和获取数据。此时我不确定最好的方法是什么。

目前我所知道的是 Spring MVC 3 提供了创建 Web 服务的能力,但它没有提供 JAX-RS 的完整实现。我还读过一些博客,讨论如何将 Spring 和 Restlet 集成在一起。另一方面,我读到我只能在 GAE 中使用 Restlet。我还想为用户提供一个轻量级的网络界面来查看他们发布的数据

所以我的问题如下。 1.我应该只使用Restlet吗? 2. 我应该只使用Spring MVC 来提供我的Restful Web 服务吗? 3. Spring和Restlet是否应该一起使用?

在这一点上,我认为我应该把时间投入到 Restlet 上,因为这似乎是在 Android 中调用 Web 服务的最佳方法。我还在争论 Spring MVC 是否已经过时了。

任何想法都会有帮助。

I'm researching how best to create a Restful web service on Google app engine. My end goal is to have an Android application call a web service on GAE to post and get data. At this point I not sure what the best approach is.

What I know at this point is Spring MVC 3 provide the ability to create web service but it does not provide a full implementation of JAX-RS. I also have read a few blog that talk about how Spring and Restlet can be integrated together. On the other side I have read that I could only use Restlet in GAE. I would also like provide a light web interface for users to view their posted data

So my questions are the following.
1. Should I just use Restlet.
2. Should I just use Spring MVC to provide my Restful web service.
3. Should I use Spring and Restlet together.

At this point I think I should invest my time in Restlet because that seems to be the best approach for calling web services in Android. I'm also debating if Spring MVC is just over kill.

Any thoughts would be helpful.

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

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

发布评论

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

评论(3

情域 2024-09-05 13:07:00

我最近在 GAE 上设置了 RESTlet,这绝对是轻而易举的事! RESTlet 网站上有文档概述了该过程,我在两个小时内就使用 Google 数据存储在 GAE 上启动并运行了 RESTlet。

主要缺点是 Google 数据存储对于低容量应用程序的性能非常糟糕。超时并不少见。 (Google 规定最多 30 秒的请求时间,如果您的应用程序最近没有被访问过,那么它在从休眠状态中出来时很容易占用一半的时间)

现在我正在构建另一个 RESTful 应用程序,并选择使用 Spring 3 MVC / Hibernate/MYSQL路线。我对 Spring DI 或 MySQL 并不陌生,但对 Spring MVC 很陌生,我花了几天时间来解决我遇到的所有问题。我对可用文档的质量感到失望,而且我无法在任何地方找到合理且完整的 Spring 3 MVC RESTful CRUD 教程。啊。

I recently set up RESTlet on GAE and it was an absolute breeze! There are docs outlining the procedure on the RESTlet website and I was up and running RESTlet on GAE using the Google datastore within two hours.

The major downside is that performance of the Google data store for low volume apps is atrocious. Timeouts are not uncommon. (Google mandates a maximum 30 second request time and your app can easily take up half of that in coming out of hibernation if it hasn't been accessed recently)

Right now I am building another RESTful app and chose to go the Spring 3 MVC / Hibernate / MYSQL route. I am not new to Spring DI or MySQL, but I am new to Spring MVC and it is taking me days to work through all the issues I am encountering. I am disappointed in the quality of available documentation and I have not been able to find a reasonable and complete Spring 3 MVC RESTful CRUD tutorial anywhere. Argh.

内心荒芜 2024-09-05 13:07:00

我没有使用 Restlet 的经验,但 Spring MVC 3.0 对于构建 Restful Web 服务和 Web 应用程序非常强大。因此,如果您还计划通过浏览器访问您的服务,那么这是一个很好的解决方案,因为您的控制器可以为应用程序和浏览器提供服务。

也许 Restlet 也可以做到这一点,但我还没有听说过它构建 Web 应用程序的功能。

请注意 Spring 的加载时间较长。这意味着您必须小心避免冷启动导致的缓慢响应。

I don't have experience with Restlet but Spring MVC 3.0 is quite powerful for building restful webservice AND webapps. So if you also plan for your service to be accessible through browsers then it is a great solution since your controllers can serve both apps and browsers.

Perhaps this is also possible with Restlet but I have not heard of its capabilities for building webapps.

Just beware that Spring has a high loading time. This means that you have to be careful to avoid slow responses from cold starts.

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