views:

144

answers:

1

hello, i want to get ip server where my tomcat is execute in java (Struts).?

+1  A: 

InetAddress.getLocalHost().getHostAddress()

Seffi
not work when i execute since my server tomcat i've got this adresse 127.0.0.1 or is wrong
Mercer
I do this and work for me:<code>String ipServer = "";ipServer = request.getServerName();</code>
Mercer