Get Client IP Address in JSP
In this example, We will show you simple program about, How to get client IP address in JSP page, When client give the request for the particular page in the web browser. This example were tested and output shared in the same post.
Example Program
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>What is my IP?</title> </head> <body> <%! String ipAddress; %> <% ipAddress = request.getRemoteAddr(); %> <h1>Your IP Address : <%=ipAddress %></h1> </body> </html>
Output
More from my site

Hello, folks, I am a founder of idineshkrishnan.com. I love open source technologies, If you find my tutorials are useful, please consider making donations to these charities.
No responses yet