Jump to content

Server URL

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
ld_pvl

ld_pvl

    Learning Programmer

  • Members
  • PipPipPip
  • 46 posts
Hello,

How can I get the current URL of the server on which my applet is currently in?

Thank you,
LD

#2
BlaineSch

BlaineSch

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,448 posts
If your on windows you can ping it in command line.

"ping www.google.com" then itll tell you.

I found a site just by googling "website ip address"
Find IP address of a website - server ip lookup

#3
ld_pvl

ld_pvl

    Learning Programmer

  • Members
  • PipPipPip
  • 46 posts

BlaineSch said:

If your on windows you can ping it in command line.

"ping www.google.com" then itll tell you.

I found a site just by googling "website ip address"
Find IP address of a website - server ip lookup

Actually what I meant was to retrieve the URL of the host containing the Applet's class.

I found out about it. To those who are looking for the same answer, you can do it like this:

public class AnApplet() extends JApplet {

      public URL GetHostUrl() {
           
           URL url; 
           url = this.getcodeBase();
           return url;
      }
}

Basically something like this.