Closed spring-projects-issues closed 12 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. :)
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.
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?
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/
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
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?
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?
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.
Arjen Poutsma commented
Change of plan: this is not going to be part of Spring-WS, but of Spring-MVC.
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.
Arjen Poutsma commented
Moved back to Spring Core
Arjen Poutsma commented
Yes, the Object/XML mapping module of Spring-WS will also be moved into the core.
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.
Arjen Poutsma commented
Unfortunately, we can't mix-and-match Spring MVC with JAX-RS in a satisfying model, because
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.
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.
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?
Arjen Poutsma commented
Resolving as fixed. More REST related issues will come up, but the overall picture is there.
Rob Harrop opened SPR-4419 and commented
Sub-tasks:
9925 URI Templates in
@RequestMapping
9926 Shallow ETag support
9934 RestTemplate
9940 Support for PUT and DELETE in spring:form tag
10082 Support for PUTting and POSTing non-form data
10125 Content negotiation
10171 Support for matrix parameters
Issue Links:
10156 Update Petclinic sample to showcase REST support
9733
@RequestMapping
: convention-based URL mapping at controller class level9602 Return 405 instead of 404 when HTTP method is not supported
Referenced from: commits https://github.com/spring-projects/spring-framework/commit/a1545e3f066feb51a1e3aa39498dff5c890d0487
38 votes, 51 watchers