This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Servlets and the fly likes Question about obtaining IP of tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Question about obtaining IP of tomcat" Watch "Question about obtaining IP of tomcat" New topic
Author

Question about obtaining IP of tomcat

Benny Tang
Greenhorn

Joined: Aug 03, 2003
Posts: 26
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

Joined: Aug 02, 2003
Posts: 29
request.getServerName()
gives you the name of the host or ip address.
http://galileo.spaceports.com/~ibidris/
 
Consider Paul's rocket mass heater.
 
subject: Question about obtaining IP of tomcat