This week's book giveaways are in the Refactoring and Agile forums. We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line! See this thread and this one for details.
Hello I'm writing a servlet which will be put on our server. A client can make a request for this servlet.I would like to retrieve the IP address of the client machine(which could be behind a firewall).What code should be put in the servlet to make this happen. Thanks in advance Sunil
posted 14 years ago
You can make use of the method getRemoteAddr() declared in the ServletConfig interface,implemented by HttpServletRequest class This method will return the string equivalent of the client IP address.The firewall shouldn't be a problem. Hope this helps, Manjunath