public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
Logger.getLogger(this.getClass()).warning("Inside Confirm Servlet");
response.setContentType("text/html");
String hostname = request.getRemoteHost(); // hostname
System.out.println("hostname"+hostname);
String computerName = null;
String remoteAddress = request.getRemoteAddr();
System.out.println("remoteAddress: " + remoteAddress);
try {
InetAddress inetAddress = InetAddress.getByName(remoteAddress);
System.out.println("inetAddress: " + inetAddress);
computerName = inetAddress.getHostName();
System.out.println("computerName: " + computerName);
if (computerName.equalsIgnoreCase("localhost")) {
computerName = java.net.InetAddress.getLocalHost().getCanonicalHostName();
}
} catch (UnknownHostException e) {
}
System.out.println("computerName: " + computerName);