• 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/
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic