Chaim Geretz
Chaim Geretz

Reputation: 856

Is there a way for a java applet to determine at run time where it was downloaded from?

Maintaining an signed applet that opens connections to the server it was downloaded from. Currently it determines the server location from a properties file that is located in the downloaded signed jar file.

This requires a separate build for qa vs production since the properties file needs to be edited before creating the signed jar. Any way to do the determination of the location of the server at run time ?

Upvotes: 0

Views: 61

Answers (2)

cdeszaq
cdeszaq

Reputation: 31280

Another way of doing this, if the page the applet is embedded in is dynamic, is to pass the current server's URL in as a parameter to the applet.

Upvotes: 0

Joachim Sauer
Joachim Sauer

Reputation: 308051

Maybe I'm missing something, but it seems you're looking for Applet.getCodeBase().

Upvotes: 3

Related Questions