Getting the WebHostName of the server

Hi everybody,

In my web-client solution I’m trying to send a file to the user. To do that I just do a showURL() to the file which is in Tomcat’s ROOT directory.
But I can’t manage to get the Web Host Name of the server. I can get the local network IP address of the server, its local Hostname but not the Host name used for internet.

How can I get this address?

Cheers.

You can’t, unless you store it yourself somewhere.

The Application Server cannot know how you expose the WebClient application to the outside world.

You can try to send a relative URL.

Paul

Although you can’t get the hostname, it is possible to get the ip using an external site like this one:

In your code you can use the http plugin to get it, like this:

var _ip = plugins.http.getPageData("http://www.whatismyip.com/automation/n09230945.asp");

Ok

Thank for your tips :D