I am learning Spring and trying make simple SOA project and I have simple test class:
@Path("/hello")
public class HelloWorldResource {
@GET
@Produces(MediaType.TEXT_PLAIN)
public String sayhello() { return "hello"};
}
But I want interface for JAX-RS and some autoinjected implementation:
@Path("/hello")
public interface HelloWorldResource {
@GET
@Produces(MediaType.TEXT_PLAIN)
String sayhello();
}
public class HelloWorldImpl implements HelloWorldResource {
@Override
public String sayhello() {
return "hello";
}
}
And I know that in Java EE I can do it with one annotation (@Stateless for example) But how can I do the same with Spring 4+?