• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Alternative to getCodeBase() ??

 
Sajee Joseph
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,
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??
 
Tim Holloway
Saloon Keeper
Posts: 18367
56
Android Eclipse IDE 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic