用于非常简单的后端服务器的最佳 Java RESTful 框架是什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3152835/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is the best Java RESTful framework for a very simple backend server?
提问by sha1dy
I need to develop a very thin shim for hadoop to be used together with Rails/Sinatra application. I'm a .Net developer and have a lot experience with Ruby. So what is the best framework to choose giving the fact it is needed for a very small project and it should provide RESTful web services.
我需要为 hadoop 开发一个非常薄的垫片,以便与 Rails/Sinatra 应用程序一起使用。我是一名 .Net 开发人员,对 Ruby 有很多经验。那么什么是选择的最佳框架,因为它是一个非常小的项目所需要的,并且它应该提供 RESTful Web 服务。
I looked at Grails and it seems to be very robust and Rails alike solution. Should I look at Spring? Or it will be an overkill for my use case?
我查看了 Grails,它似乎是非常健壮且与 Rails 类似的解决方案。我应该看看春天吗?或者这对我的用例来说是一种矫枉过正?
回答by partkyle
I really like the Play! Framework. It's a java RESTful framework that is very easy to develop in.
我真的很喜欢这部剧!框架。它是一个非常容易开发的 Java RESTful 框架。
The most notable of it's features, IMO, is that you don't have to restart the server every time you make a code change - which makes development run much more smoothly.
IMO 最显着的特性是您不必每次更改代码时都重新启动服务器 - 这使得开发运行更加顺畅。
回答by zengr
My best bet would be with Axi2's REST Support
我最好的选择是使用Axi2的 REST 支持
You also have http://www.restlet.org/and Play
你还有http://www.restlet.org/和 Play
I haven't used them though, but I like the idea of Play, Rails like framework for Java.
虽然我没有使用过它们,但我喜欢 Play 的想法,Rails 就像 Java 的框架。
回答by joshua
Have a look at activewebas well. I allows one to create very lightweight restful controllers. It support all areas of http protocol including http methods, cookies ... etc. Its based on java Servlet standard. It comes integrated with guice DI container. Whenever you change the controller, you dont have to redeploy. Controllers are hot deployed and you just refresh the browser. All configuration including routes is done using java.
也看看activeweb。我允许创建非常轻量级的宁静控制器。它支持http协议的所有领域,包括http方法、cookies等。它基于java Servlet标准。它与 guice DI 容器集成。无论何时更改控制器,都不必重新部署。控制器是热部署的,您只需刷新浏览器即可。包括路由在内的所有配置都是使用 java 完成的。
I use it as a backend for my angularjs projects
我用它作为我的 angularjs 项目的后端
回答by Lijin
回答by mikesalera
Though I have been using Grails a lot lately, I hesitate to recommend in this case. If you want to read more about what the Grails framework offers 'out-of-the-box', beyond RESTful URL mappings and core REST features, see refguide.
虽然我最近一直在使用 Grails,但在这种情况下我犹豫不决。如果您想了解更多关于 Grails 框架提供的“开箱即用”的内容,除了 RESTful URL 映射和核心 REST 功能,请参阅refguide。
Sounds as though you have the web tier and components solidified and are just looking for Java (or Groovy-) based service and DAO components, to be made available to the client with a REST api.
听起来好像您已经固化了 Web 层和组件,并且只是在寻找基于 Java(或 Groovy-)的服务和 DAO 组件,以便通过 REST api 提供给客户端。
In that case, rather than to recommend Grails, you might just encourage your server side developer(s) to install a lightweight framework in front of their POJO classes. Candidates for this I like are REST-lets and DWR direct web remoting. . .of course there are others but the concerns such as security and maturity, ease of use, etc. these are tops.
在这种情况下,与其推荐 Grails,不如鼓励您的服务器端开发人员在他们的 POJO 类前安装一个轻量级框架。我喜欢的候选者是 REST-lets 和 DWR 直接网络远程处理。. .当然还有其他的,但安全性和成熟度、易用性等问题是最重要的。
DWR 是一个 Java 库,它使服务器上的 Java 和浏览器中的 JavaScript 能够尽可能简单地相互交互和调用。
回答by krestdevelopers
Have a look at Krest on sourceforge http://javakrest.sourceforge.netIf you download the demo project you can have a full rest service running in a few minutes.
在 sourceforge http://javakrest.sourceforge.net上查看 Krest 如果您下载演示项目,您可以在几分钟内运行完整的休息服务。

