spring-projects / spring-framework

Spring Framework
https://spring.io/projects/spring-framework
Apache License 2.0
56.24k stars 37.98k forks source link

Comprehensive REST Support [SPR-4419] #9097

Closed spring-projects-issues closed 12 years ago

spring-projects-issues commented 19 years ago

Rob Harrop opened SPR-4419 and commented


Sub-tasks:

Issue Links:

Referenced from: commits https://github.com/spring-projects/spring-framework/commit/a1545e3f066feb51a1e3aa39498dff5c890d0487

38 votes, 51 watchers

spring-projects-issues commented 19 years ago

Seth Ladd commented

Rob,

I'd be very interested in this. Curious what your requirements are for a REST interface? My previous email to the list (which, after checking the list archives, I'm not sure ever got to the list):

I'm working on a project at the moment that is using Spring for REST and I'll probably integrate some of my findings into the main codebase if they warrant it. So far I have found it extremely simple to build RESTful services using Spring out of the box - I just have a few framework controllers that parse the request into a DOM Document for XML REST services, some that automatically bind XML input to a command object etc.

One of the nice things about Ruby on Rails is its support for pretty URI's that map directly to object instances. The URI's also map directly to the operations in CRUD.

The CRUD operations conform directly to the RESTful HTTP methods.

In developing a RESTful framework, I'd love to see a URL Mapper and Controller(s) that enable easy CRUD operations, such as Rails does. This would be a nice step towards a REST framework.

When talking about a REST framework, I usually mean supported GET, POST, PUT, and DELETE completely. You can emulate this w/ web browsers, as PUT and DELETE aren't supported in forms. I see another addition to a Spring REST framework is a Controller that natively handles the old doPut(), doDelete(), etc methods. Or at least, a Controller than can delegate based on the HTTP method.

We wrote a RESTful reliable messaging service using Spring, and it was very simple. The only new piece of framework code we added was the delegating http method controller, so help route each method operation. Felt like the old days of servlet programming. :)

spring-projects-issues commented 18 years ago

Tim Shadel commented

While this article claims that there really isn't any framework needs for REST that Spring should provide, <a href=http://microformats.org/discuss/mail/microformats-rest/2005-November/000042.html"">other examples [in Ruby] of useful RESTful framework functionality exist that indicate there is a need for such functionality. I'd be very interested to see Spring's support for REST be similar.

spring-projects-issues commented 18 years ago

Rintcius Blok commented

When I was looking at rest I stumbled on both this feature request and the following implementation: http://www.restlet.org/ I haven't looked at restlet in detail but the tutorial looked good to me. Maybe an idea to integrate it with spring?

spring-projects-issues commented 18 years ago

Jerome Louvel commented

Version 1.0 beta 1 of the Restlet framework was released today. I think the API is quite stable now and it could be a good time to consider an integration with Spring. I would be happy to support such an effort if anyone from the Spring community wants to lead it. http://blog.noelios.com/2006/01/26/restlet-10-beta-1-released/

spring-projects-issues commented 17 years ago

Jerome Louvel commented

Based on the feed-back of several Restlet users, we progressively improved our integration with Spring.

We have just added a FAQ entry covering the various integration modes at: http://www.restlet.org/documentation/1.0/faq#23

You can also check out the Spring extension Javadocs at: http://www.restlet.org/documentation/1.0/ext/index.html?org/restlet/ext/spring/package-summary.html

If Spring commiters are interested, we would be open to contribute some integration code to facilitate the support of REST directly from Spring.

Best regards, Jerome Louvel http://www.restlet.org

spring-projects-issues commented 16 years ago

Kim Pepper commented

While Spring MVC can handle a simple implementation, it lacks the support of many REST concepts such as:

Also, does it need to be tied to the Servlet API?

spring-projects-issues commented 16 years ago

Kim Pepper commented

Actually, I'm not sure whether Spring-WS will be a good base to build this on. The concepts of RPC and REST seem too far apart. How much common code would there be?

It might be better to start a new Spring-REST project?

spring-projects-issues commented 16 years ago

Arjen Poutsma commented

First off, Spring-WS is not RPC, it is XML messaging :).

But I agree: the REST support will not be based on the SOAP/POX part of Spring-WS, though we will leverage the XML Marshalling module in there. It is just going to be part of the Spring-WS project.

spring-projects-issues commented 16 years ago

Arjen Poutsma commented

Change of plan: this is not going to be part of Spring-WS, but of Spring-MVC.

spring-projects-issues commented 16 years ago

Oliver Drotbohm commented

Is there already a ticket in Sring Core Project for this? I guess it would be to be found in WEB component, won't it? Will the marshalling support currently available with SpringWS also be moved (as it would be usable for rest responses , too)?

There is a Google Code project, that seems to have some nice ideas on using MVC controllers and Annotations to provide dedicated support:

http://code.google.com/p/polarrose-spring-rest/

Regards, Ollie.

spring-projects-issues commented 16 years ago

Arjen Poutsma commented

Moved back to Spring Core

spring-projects-issues commented 16 years ago

Arjen Poutsma commented

Yes, the Object/XML mapping module of Spring-WS will also be moved into the core.

spring-projects-issues commented 16 years ago

Daigo Kobayashi commented

How does spring team implements REST support? Does spring team has any plan to integrate with JAX-RS(JSR-311)? I think Spring 2.5's mvc introduce similar concept of JAX-RS. So JAX-RS integration is reasonable.

spring-projects-issues commented 15 years ago

Arjen Poutsma commented

Unfortunately, we can't mix-and-match Spring MVC with JAX-RS in a satisfying model, because

  1. JAX-RS annotations overlap with the Spring MVC annotations introduced in 2.5. This could result in duplicate request mappings, for instance.
  2. JAX-RS is semantically different than Spring MVC, i.e. stateful vs. stateless
  3. JAX-RS focusses on RESTful web services only, while Spring MVC focusses on web sites.

This does not rule out the possibility of using a JAX-RS as a backend to Spring MVC, something we are considering. Finally: we are also considering offering JAX-RS support in 3.0/3.1, in the same way we did for JAX-WS in Spring 2.5.

spring-projects-issues commented 15 years ago

Arjen Poutsma commented

As much as I like the "Comprehensive" in the name of this issue, it's rather difficult to track when it's done :). So I will start creating some sub tasks under this issue, to indicate where we are taking this.

spring-projects-issues commented 15 years ago

Hellmut Adolphs commented

Guys, I have a couple of questions... if the JAX-RS annotations overlap with Spring MVC, how does this affect spring integration with CXF 2.2 which supports the final version of JSR-311? currently I am able to use the CXF 2.2 servlet supporting JSR-311 using spring 2.5... with the plans to add Rest services to Spring MVC.. how does this all fit together in terms of architecture, integration and so on? are this two going to be 2 completely different approaches to do RESTful web services ? spring MVC alone OR spring core with CXF?

spring-projects-issues commented 15 years ago

Arjen Poutsma commented

Resolving as fixed. More REST related issues will come up, but the overall picture is there.