dcsimg
Get application server name and/or IP address
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Packer_Pete
Posted On:   Monday, September 16, 2002 04:56 AM

Is there a way to get the name and or IP address of the specific application server a bean is running on. I'm using the latest resin release with IIS on a seperate machine for a webserver.

Thanks in advance.

Re: Get application server name and/or IP address

Posted By:   d_d  
Posted On:   Monday, September 16, 2002 09:02 AM

You may use java.net.InetAddress. Here is an example:



InetAddress ia = InetAddress.getLocalHost();

String name = ia.getHostName();

String IP = ia.getHostAddress();



or, more generally:



InetAddress add[] = ia.getAllByName(ia.getHostName());

...

String name = add[i].getHostName();

String IP = add[i].getHostAddress();

...
About | Sitemap | Contact