I am working on a web application in jsp in which I need to get the local domain name. For example if working on local server, I want to get local server name as "localhost" or while working on some online server, the server name as "www.server.com".
Is there any method to get the domain name of local server in jsp?