Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ip or name of server

 
siva prakash
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

i am having application that runs in one of many servers ( due to load balancing). i need to find the server ip or its name in which the request is processed. i should not use servletrequest object.

is there any way.


With Regards,
prakash.
 
Jean-Sebastien Abella
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do not know if there is one more specific to your problem but if you are on windows(I'm sure there would be an equivalent on other platform)
the command "ping -a localhost" will give you the name of the current machine
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See if NetworkInterface.getNetworkInterfaces() and then anInterface.getInetAddress() does what you need. They might come up with more than one answer
[ September 07, 2005: Message edited by: Stan James ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic