I am trying to come to a decision on a architecture solution for some new projects that I am building.
These projects need to be multiplatform, mobile, tablet, desktop, etc.
So therefore the reason to choose a RESTful api(json) for the backend/server.
I have been working on Java EE for long time, so expirmenting with Spring and Java EE 6 at the moment, but both seem quite straightforward, Spring just seems to have so much more configuration and layers.
I have been looking at Spring 3.1 Rest vs Java EE 6 Resteasy/Jersey.
All have been pretty easy to setup,
Spring I used the @EnableWebMvc and the new httpMessageConverters, etc
RestEasy/Jersey
It seems in RestEasy/Jersey that the content returned by the web service can be determined by the request (json/xml/html…) Is it the same in Spring?
Any other advice would also be very helpful,
Thanks
The big advantage of Spring over other frameworks is the possibility to exchange almost all of the default compontents with your own.
In your case the ContentNegotiationViewResolver is probably the one to go. It allows you per default to determine the requested transferable type by the accept header, by the format url parameter or by extension (e.g. .json/.xml)
See the following to get some examples and explanations: http://static.springsource.org/spring/docs/3.0.0.M3/spring-framework-reference/html/ch18s02.html