I am trying to find the current host of my application in order to make some implementations, I went through different Java Backend objects (resource, request, resourcePage..) but all the properties that I have found give me relative paths. What is the best way to get the host where the call was initiated?
Here is a list of global objects that I have been looking through: http://docs.adobe.com/docs/en/aem/6-0/develop/sightly/global-objects.html
I'm little bit confused if you try to resolve the host through java or javascript, that's why I'll post both of the solutions. If you mean something else than please extend your question or create new one.
Javascript:
Java:
or if you try to resolve some resource url in Java, you can use the com.day.cq.commons.Externalizer which can be adapted from the org.apache.sling.api.resource.ResourceResolver and uses the settings in your map file /etc/map