If we use it in the page http://www.somedomain.com/somepage..?=blah&two=blah, only www.somedomain.com have to be returned. I tried using
request.getScheme().toString() + "://" + request.getRemoteHost()`
But its returning an IP address, which is of no use for me. Kindly advice.
Thanks in advance