TomEE 1.7.2, Java EE 6, Java 8
I have this JAX-RS Application:
@ApplicationPath("/api")
public class CallStatsCatcherApplication extends Application {
@Override
public Set<Class<?>> getClasses() {
return new HashSet<Class<?>>(Arrays.asList(RestEndpoint.class));
}
}
@ApplicationScoped
@Path("/rest")
public class RestEndpoint {
@GET
public String echo(@QueryParam("foo") String foo) {
return foo;
}
}
During startup, TomEE prints:
INFO: GET http://localhost:8080/test-application/api/rest/ -> String echo(String)
How can I get that URL programmatically during startup? I'd like to create a framework that advertises this URL locally on the network.