Monday, June 12, 2017

JAX-RS with CXF without Spring

In this post, we will see, how to implement JAX-RS with CXF without using the Spring. Instead of using the Servlet org.apache.cxf.transport.servlet.CXFServlet we will be using the Servlet org.apache.cxf.jaxrs.servlet.CXFNonSpringJaxrsServlet. When using the CXFNonSpringJaxrsServlet, there is no need for servlet.xml, since the configuration of the endpoints and provider will be taken
automatically done, by the jaxrs.serviceClasses at runtime. Note: this will not generate the WADL file, that's the only disadvantage.

Rest of the items are similar to the normal CXF implementation.


Happy Programming...!!

No comments:

Post a Comment