I want to be able to access, statically (or globally somehow) the URL of my own application, that is, I want to know the URL of the root context path, so for instance if it is in:
http://example.com/contextroot/
I want to be able to get this information in any part of my app. So I guess I have to obtain this information after the application is initialized, my instincts tells me it is somewhere among listeners or Servlet interceptors, but I'm not sure where can I store this information in, for example, a Singleton.
@RequestMapping(value="/contextroot", method = RequestMethod.GET)?