razia5
January 23rd, 2003, 01:58 PM
Hi. Could someone tell me how to get the IP address of all clients connected to the server in jsp? Also, I want to know how to get the IP address of my machine in jsp. Please can anyone help me?
|
Click to See Complete Forum and Search --> : How to get the IP address in JSP? razia5 January 23rd, 2003, 01:58 PM Hi. Could someone tell me how to get the IP address of all clients connected to the server in jsp? Also, I want to know how to get the IP address of my machine in jsp. Please can anyone help me? Goodz13 January 23rd, 2003, 03:42 PM // gets the remote IP String sIPAddress = request.getRemoteAddr(); Not sure how to get your local IP. dlorde January 23rd, 2003, 05:34 PM InetAddress.getHostAddress() (http://java.sun.com/j2se/1.4/docs/api/java/net/InetAddress.html#getHostAddress()) returns the IP address of the local host (oddly enough :cool: ). All things have savour, though some very small, Nay, a box on the eare hath no smell at all... razia5 January 25th, 2003, 03:40 PM Hi. I already know the InetAddress.getHostAddress but I wanted to know if there is something specific in jsp to get the local IP address ,e.g, request.something dlorde January 25th, 2003, 04:18 PM I'm not really sure I understand you... are you saying you think there should be another method to return the local IP address besides InetAddress.getHostAddress()? If you want request information, I suppose you could call HttpServletRequest.getRequestURL() to get the URL the client used to make the request. This will include the protocol, server name, port number, and server path, but it won't necessarily be the IP address. Those whom God wishes to destroy, he first makes mad... codeguru.com
Copyright Internet.com Inc., All Rights Reserved. |