Let’s Compare: JAX-RS vs Spring for REST Endpoints

amihaiemil

You did not compare apples to apples, you compared apples to pears to begin with!

You regard JAX-RS as a standalone framework, which it is not!

1) Jax-rs is a component of JavaEE, you do not even need to know whether you are using Jersey or RestEasy – it is a specification, an API, the implementation should be irrelevant. And your code snippet seems a lot more complex than it should be.

2) Spring and JavaEE (including JAX-RS) are competitors, rivals, you should never put them together in a project, it makes no sense. It only shows that you have no idea what you are doing, architecture-wise.

3) There is no comparing JAX-RS to Spring Rest since, as I said at 1), jax-rs is a thin API, your deployable will hold no dependency and the runtime implementation will be provided by the platform (Glassfish, Jboss etc). I have no idea why would you use JAX-RS to create a monolith and run it with jetty…

I explained JAX-RS in this article: http://www.baeldung.com/jax…