Confusion with JAX-RS and Jersey with JAX-RS

前端 未结 3 1364
面向向阳花
面向向阳花 2021-01-13 04:01

I\'m really confused of this. I have tried a Jax-rs with a tomcat and using all the annotations i was able to call my service using a url. So without Jax-rs I c

3条回答
  •  -上瘾入骨i
    2021-01-13 04:28

    JAX-RS

    JAX-RS is a standard for creating REST APIs. Even you can build a library like jersey to build an implementation of the standard. JAX-RS is part of the JavaEE stack like JMS and others. So application servers like JBoss come bundled with jax-rs and jms.

    Why Jersey?

    JAX-RS doesn't come bundled with tomcat. Jersey can work with servlet containers like Tomcat, Jetty etc. This is similar to ApacheMQ which can make containers do JMS. It is designed to extend servlets to create rest endpoints. It is also an implementation of JAX-RS. Implementing the standard makes it consistent with code written for JAX-RS.

    Alternatives

    There is apache-cxf, which implements JAX-RS and does SOAP & REST both. I have been using jersey myself for years. Since I liked working with tomcat. Now we help built metamug, a framework on tomcat for REST APIs with XML.

提交回复
热议问题