I want to use Spring boot with JAX-RS (Jersey Implementation). If we were not using Spring Boot, we could use the following code to register all the Rest service classes
@ApplicationPath("/myrest") public class MyApplication extends Application { @Override public Set<Class<?>> getClasses() { Set<Class<?>> s = new HashSet<Class<?>>(); s.add(HelloWorld.class); return s; } } This works fine in a Servlet 3.0 supported container.
But when we use Spring Boot with JAX-RS(Jersey) why do we have to extend from org.glassfish.jersey.server.ResourceConfig Why extending from javax.ws.rs.core.Application doesn't work?
ResourceConfigand annotate your config class with@Component, otherwise Spring won't know about your services.