Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jersey on Spring Boot - ApplicationPath

Is there a more programmatic way, equivalent to the below config:

@ApplicationPath("api")
public class MyResourceConfig extends ResourceConfig {

, of setting the application path for Jersey app? I wanted to make it configurable and maybe make use something like:

property("jersey.config.<application.path>", api);

with addtitinal:

@ConfigurationProperties(prefix = "jersey")
public class MyResourceConfig extends ResourceConfig {

@Setter @Getter protected String api;
like image 351
m52509791 Avatar asked Jan 27 '16 21:01

m52509791


People also ask

Do spring boots use jersey?

The spring-boot-starter-jersey is a starter for building RESTful web applications using JAX-RS and Jersey. It is an alternative to spring-boot-starter-web . The spring-boot-starter-test is a starter for testing Spring Boot applications with libraries including JUnit, Hamcrest and Mockito.

What is jersey config?

A Jersey Configuration is a class that extends from ResourceConfig from the jersey library. A Jersey Configuration class will typically define an @ApplicationPath annotation specifying path to connect via REST.


1 Answers

You can set spring.jersey.application-path config in your application.properties.

like image 115
Ali Dehghani Avatar answered Oct 27 '22 09:10

Ali Dehghani