title: How to check inside Java code if the server is running in localhost
body: <p>I have the need to check at runtime if the server is running in <a href="http://localhost" rel="noreferrer">http://localhost</a>
  Searching on the net I haven't found any good solution.
  Some advice?</p>
  
  <p>Thank you </p>