hi.. i have a JSP program .. in which before inserting a record i need to capture the IP address of the machine from where the record is being inserted ....can any one please help me on that..!!! Thanxs in advance for help..!!!
if i use out.print( request.getRemoteAddr() );out.print(request.getRemoteHost() ); method...it gives me the local host ipaddress .... but it doesnot give me the machines ipaddress....how do i get the machine ipaddress of a user ... who is accessing my web pages.... please help..! thanxs..!
hi rekha, request.getRemoteAddr() is the method to do that as william said. you might be trying to access the JSP page from same machine on which you server is. in that case of course the IP address returned will the of the same localhost machine. try acessing the page from some other machine other then server and then see what is gives. Bye and best of luck Amit
****************************<br />In 24 hrs Earth rotates once on its Axis.
Joined: Jan 29, 2004
yeh i got it using out.print( java.net.Inet4Address.getLocalHost().getHostAddress() ); . thanxs for all the help...!