Results 1 to 3 of 3

Thread: Get IP address for local machine

  1. #1
    Join Date
    Nov 2006
    Posts
    218

    Default Get IP address for local machine

    Hi,

    how can I get with "Spring" the machine-IP where a spring-application is installed?

    Thanks,
    Julio

  2. #2
    Join Date
    Jun 2005
    Posts
    4,230

    Default

    java.net.InetAddress.getLocalHost() might be what you need. Nothing to do with Spring.

  3. #3
    Join Date
    Nov 2004
    Location
    Hilversum - The Netherlands
    Posts
    1,054

    Default

    And if you want to inject this value into some bean, you can always use the MethodInvokingFactoryBean to call the method. See the documentation for more information.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •