How can I get the IP address of a server in my JavaWS application from which it was downloaded?
Thank!
I think use BasicService.getCodeBase.
BasicService.getCodeBase
You will need to get jnlp.jar and add it to your application. I had to find it in the JDK samples and demos that are distributed separately from the JDK. I used this sample and demo question to find it. I was able to get it using a url like http://download.oracle.com/otn-pub/java/jdk/8u11-b12-demos/jdk-8u11-windows-i586-demos.zip
jnlp.jar , , URL- , , .
import javax.jnlp.*; BasicService bs = (BasicService)ServiceManager.lookup("javax.jnlp.BasicService"); URL codebase = bs.getCodeBase();
Source: https://habr.com/ru/post/1795498/More articles:open source instant messenger? - c #Understanding how WCF works - silverlightany open source messenger? - c #How to manipulate .doc files - javaParent and child flags - javascriptSearch "Samples and Demos" for a specific JDK version - javaHow to prevent a log from exiting from Apache Commons Exec - javaWhen using OleDBDataReader to select the memo field from the Access database, it returns part of the string. How can I get the whole line? - c #Telephone encryption encryption - encryptionCreating a Partial Patch File / Using TortoiseSVN - svnAll Articles