Instead of Spring MVC, Boot application can be integrated with one of the available JAX-RS implementations (e.g. Jersey, Apache CXF etc). In this example, we will see how to use Jersey. Following are the steps to achieve that:
Add spring-boot-starter-jersey dependency.
Register JAX-RS resource (annotated with JAX-RS annotation) as a bean.
Register the resource class, created in step 2, with org.glassfish.jersey.server.ResourceConfig. The instance of ResourceConfig is itself needed to be registered as Spring bean.