谁能推荐一个基于MVC并支持REST的Java Web框架? [英] Can anyone recommend a Java web framework that is based on MVC and supports REST?

查看:20
本文介绍了谁能推荐一个基于MVC并支持REST的Java Web框架?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们希望在 Web 应用程序中托管 Java 域模型(使用 DDD 编写).理想情况下,我希望支持 RESTful 资源和请求,拥有一个站点来支持用户和 REST api.

We are looking to host a Java Domain Model (written using DDD) inside a web application. Ideally I would like to support RESTful resources and requests, having a single site to support both users and a REST api.

理想情况下,最终用户和给定功能的 RESTful API 可以使用相同的 url(使用 HTTP 内容类型/协商指定差异).

Ideally the same url could be used for both end users and the RESTful API of a given feature (with HTTP content types / negotiation specifying the difference).

我在 Ruby on Rails 和 Asp.mvc 中做过类似的应用程序,但没有在 Java 中做过类似的事情的经验.有人对从哪里开始有经验或建议吗?(谷歌搜索表明 Spring v3 可能是一个答案,有人对 Spring 3 有任何想法吗?)

I have done similar apps in Ruby on Rails and Asp.mvc, but have no experience doing anything like this in Java. Anybody have an experience or advice on where to start ? (Googling suggests that Spring v3 might be an answer, anybody have any thoughts on Spring 3 ?)

推荐答案

对于网络服务,Jersey 是好,易于.Spring 3 听起来不错,但它还没有发布,而且 Jersey 功能齐全,开箱即用地支持 SOAP 和 JSON.除了将 servlet 添加到您的 web.xml 文件之外,这一切都是基于注释的,这使得它可能比 Spring 插件更容易配置,但为了避免被骂,我会说可能不会.

For web services, Jersey is nice and easy. Spring 3 sounds like it will be good, but it's not out yet, and Jersey is full featured and supports SOAP and JSON out of the box. It's all annotation based aside from adding the servlet to your web.xml file which makes it probably easier to configure than even Spring plug-ins, but to avoid getting yelled at, I'll say maybe not.

对于 (MVC) 网页(用户 UI),我使用 Spring MVC 或 Struts.

For (MVC) web pages (user UI), I use Spring MVC or Struts.

这篇关于谁能推荐一个基于MVC并支持REST的Java Web框架?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆