Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question about obtaining IP of tomcat

 
Benny Tang
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Since I want to find out the IP of the machine which is running tomcat, I know that it can be obtained by using the class InetAddress. But is there any other ways that can obtain the same information like using class ServletContext, HttpServletRequest.....
Thanks for your kind attention.
Benny
 
ib idris
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
request.getServerName()
gives you the name of the host or ip address.
http://galileo.spaceports.com/~ibidris/
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic