Link to home
Create AccountLog in
Avatar of gng
gng

asked on

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 !
ASKER CERTIFIED SOLUTION
Avatar of fontaine
fontaine

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of terajiv
terajiv

Hi fontaine
can u pl. tell me this method belongs to which class ?
Hello Terajiv,

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

Bertrand
Thanx fontaine...