Home
Languages
Java
Android
C
CPP
Dot Net
Technology
GWT
Struts
Spring
DB
Database
Sql
Scripts
BatchScript
JavaScript
Bootstrap
Auto It
UI Path
Others
Ubuntu OS
Eclipse
Tomcat
Cmd Prompt
Tips
Monday, 10 December 2012
How to get IpAddress in Servlet
How to get IpAddress in Servlet
How to get IpAddress in Servlet
HttpServletRequest request=getThreadLocalRequest();
String ipAddress = request.getHeader("X-FORWARDED-FOR");
if(ipAddress == null)
{
//this is for local address
ipAddress = request.getRemoteAddr();
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment