java获取当前服务器ip
public static String getIp(){ try { InetAddress ia=InetAddress.getLocalHost(); // String localname=ia.getHostName(); String localip=ia.getHostAddress(); return localip; } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); return "500"; }