HttpServletRequest getRemoteAddr() not working how I would expect
问题 The following code is returning incorrectly, from what I understand: HttpServletRequest httpRequest = (HttpServletRequest) request; String userIPAddress = httpRequest.getRemoteAddr(); // Actual // "0:0:0:0:0:0:0:1%0" // Expected // "0:0:0:0:0:0:0:1" Any idea why the %0 is there? When I loop through InetAddress.getAllByName("localhost") I get the following: // ["192.168.100.1", "127.0.0.1", "0:0:0:0:0:0:1"] How would I test for localhost if getRemoteAddr() is returning invalid format, or am I