| Author |
Need Help getting Referrer IP in Servlet
|
Randall Stevens
Ranch Hand
Joined: Jul 01, 2003
Posts: 65
|
|
I have a situation where an Access Controller is redirecting the request to my server. The question I have is how do I retreive the IP address of the Access Controller? brief code examples would be appreciated, as it has been a long time since I have worked with Servlets and JSPs. Randall
|
 |
Mike Curwen
Ranch Hand
Joined: Feb 20, 2001
Posts: 3695
|
|
I'm assuming you're retrieving the IP address of the Controller, while you are in the responding servlet (the application the Controller redirects to). For the originating server, you use request.getRemoteHost() and request.getRemoteAddr() FWIW: I'm not actually sure of how to retrieve the IP address of the responding server, but you get the hostname of the responding server with request.getServerName()
|
 |
 |
|
|
subject: Need Help getting Referrer IP in Servlet
|
|
|