<HTML>
<BODY>
<%
// This scriptlet declares and initializes "date"
System.out.println( "Evaluating date now" );
java.util.Date date = new java.util.Date();
%>
Hello! The time is now
<%
out.println( date );
out.println( "<BR>Your machine's address is " );
out.println( request.getRemoteHost());
%>
</BODY>
</HTML>
In the JSP code above, I thought request.getRemoteHost() would return the ip address of the browser host. However, it returned something like: 0:0:0:0:0:0:0:1. What’s the problem?
It’s indeed the IP of the machine running the browser, so it’d return
127.0.0.1, or in your case::1, which is localhost in IPv6.