Springbott support jersey, if jersey2.x only need to rely on Spring-boot-starter-jersey.
Then you need to configure ResourceConfig
@Component Public class extends ResourceConfig { public jerseyconfig () { Register (Endpoint. class ); }}
Endpoint class to have @components and HTTP resource annotations (@Get, etc.)
@Component @path ("/hello") Public class Endpoint { @GET public String message () { return "Hello"; }}
Because endpoint is a component of Spring (Component) and is managed by spring, you can inject its properties through @autowired and inject configuration values through @value.
The Jersey Servlet will match/* By default, and you can restrict it by adding @applicationpath to ResourceConfig.
The default jersey is built in a servlet in the class Servletregistrationbean corresponding Bean, which is named Jerseyservletregistration. By default, the servlet is lazy loaded, and you can customize it by using the Spring.jersey.servlet.load-on-startup property. You can override the above bean by creating a bean of your own class and giving him the same name as above.
You can also set the filter order by Spring.jersey.filter.order by setting the property spring.jersey.type=filter to Jersey as a filter instead of a servlet ( Corresponding to the servlet's @order).
Both the filter and the servlet can pass initialization parameters through spring.jersey.init.*.
Click on the link to see the official Spring jersey example to get an overview of how to create a Jersey project.
Springboot of Jax-rs and Jersey