I wanted to have base uri for my rest application at the time when servlet context get initializing. It is easily available at resource classes with the help of UriInfo. But I need it at the time my app is getting initialize. i am using jersey api (2.13).
Can any body suggest the way to get the base uri.
@ApplicationPath("rest")
public class RestApplication extends ResourceConfig {
public RestApplication() {
// I Need The Base URi Here
}
}
Or may be in this method
public void contextInitialized(ServletContextEvent event) {
// I Need The Base URi Here
}