IP-Addresse mit Java ermitteln

Hallo an alle,

ich habe ein Servlet, daß auf Tomcat läuft.

Kann ich mit JAVA die IP-Adresse des Users ermitteln, der das Servlet aufruft ?

InetAddress scheint nicht zu gehen.

Vielleicht hat jemand von euch einen Tip für mich.

Vielen Dank im voraus.

Wolfgang

Hallo Wolfgang,

Du kannst über den Request getRemoteAddr() aufrufen

public java.lang.String getRemoteAddr()
Returns the Internet Protocol (IP) address of the client that sent the request. For HTTP servlets, same as the value of the CGI variable REMOTE_ADDR.
Returns:
a String containing the IP address of the client that sent the request

Gruss, Simon