Tutorials4u.net Forum

Full Version: Get client IP address from JSP
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
<%
out.print( request.getRemoteAddr() );
out.print( request.getRemoteHost() );
%>

You may not get the real client IP if a the client is behind a proxy, you will get the IP of the proxy and not the client. However, the proxy may include the requesting client IP in a special HTTP header.

<%
out.print( request.getHeader("x-forwarded-for") );
%>
Reference URL's