Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to get the IP address of machine where the jsp file is opened  RSS feed

 
Rekha Pai
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I use the following code it gives the IP address of the machine where the tomcat server resides. How to get the address of client machine where the jsp file is opened in the browser.

InetAddress iAddr = InetAddress.getLocalHost();
out.println(iAddr.getHostName());
 
Vijitha Kumara
Bartender
Posts: 3992
27
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
check the ServletRequest at Servlet API for getRemoteAddr() method.
[ November 03, 2008: Message edited by: Vijitha Kumara ]
 
Rekha Pai
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Vijitha Kumara:
check the ServletRequest at Servlet API for getRemoteAddr() method.

[ November 03, 2008: Message edited by: Vijitha Kumara ]


Thanks Vijitha.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!