Getting the real (virtual) host name under an application server
I have an application running under Jetty, and I want the application to return self referencing absolute URLs (when generating an RSS feed, so a client must be able to work without a "current URL" context). The problem is that I don't know ahead of time under which host name the application will be deployed, and it is quite likely that it will be deployed in a virtual hosting environment where several host names are mapped to the same IP address. I've tried using HttpServletRequest.getLocalName() , but that returns the resolved host name[1] for IP address on which the request was received