任何人都可以推荐基于MVC的Java Web框架并支持REST吗? [英] Can anyone recommend a Java web framework that is based on MVC and supports REST?

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

问题描述

我们希望在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.

理想情况下,两个最终用户都可以使用相同的URL和给定功能的RESTful API(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 ?)

推荐答案

对于Web服务,< a href =http://jersey.java.net/ =nofollow noreferrer>泽西岛非常简单。 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)网页(用户界面),我使用Spring MVC或Struts。

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

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

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