File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Rekha Pai
Ranch Hand
Posts: 35
  • 0
  • 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: 3908
9
Chrome Fedora Hibernate
  • 0
  • 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: 35
  • 0
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic