diff --git a/spring-boot-samples/spring-boot-sample-jersey/src/main/java/sample/jersey/Endpoint.java b/spring-boot-samples/spring-boot-sample-jersey/src/main/java/sample/jersey/Endpoint.java index 0a1d6cd707d..efe8acd1e56 100644 --- a/spring-boot-samples/spring-boot-sample-jersey/src/main/java/sample/jersey/Endpoint.java +++ b/spring-boot-samples/spring-boot-sample-jersey/src/main/java/sample/jersey/Endpoint.java @@ -26,9 +26,13 @@ import org.springframework.stereotype.Component; @Path("/hello") public class Endpoint { - @Autowired private Service service; + @Autowired + public Endpoint(Service service) { + this.service = service; + } + @GET public String message() { return "Hello " + this.service.message();