| Author |
Is my app launched via webstart
|
Ronnie Phelps
Ranch Hand
Joined: Mar 12, 2001
Posts: 329
|
|
|
I have an application that can be launched via webstart or outside of webstart. I know there is a way of checking whether the current application was launched via webstart or outside of webstart but I don't remember what the code looked like or where to find it. If anyone has an idea, let me knwo.
|
 |
Sailaja Akkineni
Greenhorn
Joined: Sep 06, 2003
Posts: 9
|
|
Hi, I hope this would help you.Check out this URL http://java.sun.com/products/javawebstart/faq.html#5 Sailaja
|
 |
Smita Mangal
Greenhorn
Joined: Oct 16, 2003
Posts: 1
|
|
Hi, In the JNLP file u can provide the commandline arguments. And in the main method check the parameter, this way u can confirm the source of application whether via Java Web Start or not. The arguments can be passed through JNLP file like: <application-desc main-class="venus.Tool" /> <application-desc main-class="com.abc.MyClass"> <argument>-jconsole disable</argument> <argument>show</argument> </application-desc> Hope this helps Thanks Smita
|
 |
Ian Hand
Greenhorn
Joined: Oct 16, 2003
Posts: 3
|
|
I used a system property for this, this line in the resources section of my .jnlp: <property name="webstart" value="true"/> Then System.getProperty("webstart") will return the String "true" if you are running from web start, null otherwise. So your application can do: if(System.getProperty("webstart") != null) { // web start specific behaviour } (you might want to check that the right value is returned, just in case someone else has set the system property.) Dunno how robust this is, but hope it helps [ October 16, 2003: Message edited by: Random Username ]
|
 |
 |
|
|
subject: Is my app launched via webstart
|
|
|