Difference between JAX-RS and Spring Rest

前端 未结 4 1589
甜味超标
甜味超标 2020-12-02 03:39

I confused with the difference between JAX-RS (well, maybe should use Jersey to do comparison since JAX-RS is just spec) and Spring for Restful serv

4条回答
  •  时光说笑
    2020-12-02 04:04

    I worked with both Jersey Rest, spring rest and Jersey Rest with spring. Both of them are very rich frameworks with nice implementations. I would suggest it's better to go with Spring rest if you are using other Spring services such as ORM ,Spring security and DI etc. Both are spring libraries, so I feel a little bit easy for managing code and dependencies

    JAX-RS pros:

    • JSR standard can be run without servlet container (grizzly, simple, ...)
    • Production-ready implementations (jersey, cxf, resteasy, restlet, ...) designed for REST applications only

    Spring MVC pros:

    • Provide "full" stack, not just REST facilities

    • Dependency injection / AOP / Transactions

    • Pluggable view templates (JSP, freemarker, velocity, ...)

    You can check more on the following links

    1. https://www.infoq.com/articles/springmvc_jsx-rs
    2. Why use JAX-RS / Jersey?

提交回复
热议问题