This week's giveaway is in the Java/Jakarta EE forum. We're giving away four copies of Java EE 8 High Performance and have Romain Manni-Bucau on-line! See 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
It's one of the http headers - REMOTE_ADDR. However, it's not reliable for general use - it can be spoofed, translated, or otherwise removed or tampered with. Check the servlets forum and you'll see a fairly detailed discussion that went on about this a week or so back.
An IDE is no substitute for an Intelligent Developer.
"Jolly Jumper", The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please log in again with a new name which meets the requirements. Thanks. Dave.