I've had good experience with Spring MVC REST with a couple of solid projects delivered. My question is about JAX-RS compliance. Does it matter because Spring is here to stay and I don't foresee (nor have a reason to) having to move away from Spring MVC REST to Jersy or any other JAX-RS impl any time soon. Anything that should force me to think about using JAX-RS implementation as opposed to Spring MVC REST?
-
2REST is REST, regardless of if it is implemented with Spring MVC, Jersey or other web framework. – Sotirios Delimanolis Nov 15 '13 at 17:52
-
3@SotiriosDelimanolis I understand that. My question is about the significance (or insignificance) of JAX-RS compliance. If I have something to worry if I choose to stick with Spring MVC REST. – user6123723 Nov 15 '13 at 17:57
-
1Why do you care about JAX-RS compliance? You're building a RESTful architecture. Doesn't matter if it's compliant with a language specific API. – Sotirios Delimanolis Nov 15 '13 at 18:01
-
8@SotiriosDelimanolis - It really matters which library is choosen, when we go outside the standard the community support in terms of other libraries like rest doc library (swagger) and other things which might work with the standards won't work or will take time to have a specific one for each platform. So your effort might be wasted. So please stop closing questions, when you don't understand the full intent and its repercussions. – DarkKnight Jul 10 '14 at 12:48
-
@DarkKnight Notice the _reason_ for the close vote. Both JAX-RS and its implementations and Spring MVC give you the tools you need to implement an application with a REST architecture. Anything else is opinion. That is, unless it is about technical details. OP has not asked about any technical details in their question. – Sotirios Delimanolis Jul 10 '14 at 14:48
-
7@SotiriosDelimanolis - The questions is very specific being 'Spring not supporting JAX-RS compliance', is it not related to technical area , for its support / libraries which I have already explained ?. I am repeating if the intent is not fully understood, it is not nice to close the question. – DarkKnight Jul 11 '14 at 05:51
-
2I've voted to reopen the question, even if I doubt these people will understand the importance of it. – Sridhar Sarnobat Apr 16 '18 at 18:57
1 Answers
IMHO, if your web application returns JSON/XML only, there is no big difference. However, if some end points of your web application need to return HTML, Spring MVC is better. The reason I think so is that JAX-RS does not provide any MVC mechanism (AFAIK). Jersey (one of JAX-RS implementations) provides Viewable/Template to support MVC, but it is a Jersey-specific feature and not a part of JAX-RS specification.
Chapter 18. MVC Templates
https://jersey.java.net/documentation/latest/mvc.html
Also, this blog may give you some insights.
Jersey JAX-RS MVC Killed the Spring MVC Star
http://sleeplessinslc.blogspot.jp/2012/02/jersey-jax-rs-mvc-killed-spring-mvc.html
(The conclusion of the blog is different from its title, though.)
EDIT - here's the answer to the question asked:
Standardized annotations
As the 2nd link above says:
Jersey is a JAX-RS implementation, one could swap out Jersey for another provider like RestEasy if desired without much effort. Spring MVC on the other hand has REST web service support but the same is not a JAX-RS implementation and therefore one is tied to Spring MVC.

- 25,183
- 12
- 93
- 106

- 18,118
- 9
- 62
- 105
-
1I hope you don't mind but I'm adding what I think is the key line from the great article you cited. – Sridhar Sarnobat Apr 16 '18 at 19:01