Obtaining a client IP address in a JSP

Has anyone any idea on the way to get the client IP address when running a Java Server Page (JSP) ? I've looked at the java.net.InetAddress class and it looks good, but all I get is the server's IP address. The solution musyt work for both IE and Netscape.

Thanks in advance !
gngAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
fontaineConnect With a Mentor Commented:
Invoke the getRemoteAddr() method on the request object available to your JSP file.

String remoteIP = request.getRemoteAddr();
0
 
terajivCommented:
Hi fontaine
can u pl. tell me this method belongs to which class ?
0
 
fontaineCommented:
Hello Terajiv,

The request object is an instance of HttpServletRequest. HttpServletRequest extends ServletRequest. The getRemoteAddr() method belongs to ServletRequest.

Bertrand
0
 
terajivCommented:
Thanx fontaine...
0
All Courses

From novice to tech pro — start learning today.