• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

Alternative to getCodeBase() ??

Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way to get the Server ip address from an applet running on the client system. I know getCodeBase() or getDocumentBase() can be used. But i'ev got a problem here. When the applet is run on Internet Explorer getCodeBase() returns only the Server ip . But in Netscape it returns the Ip followed by Index.html. In this case i have to parse the getCodeBase() to get just the Server IP.I'm using Tomcat Server.
How do i fix it??
Saloon Keeper
Posts: 22127
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using getHost() on the URL returned by getCodeBase?
I must admit, I don't see anything in the specs that say that getCodeBase MUST return an IP address anyway, so I don't know that you're doing this reliably. An IP address might not be authoritative anyway if you referenced a clustered server where the same hostname might return a connection to a different machine for each hit.
Sasparilla and fresh horses for all my men! You will see to it, won't you tiny ad?
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic