I need to open a Java Swing application at client side on calling a servlet. Few arguments are also required to be received at the main method of that Swing application which gets opened via JNLP at a client browser. In my case the swing app is getting opened but no arguments are be received in anyway.
My JNLP file is not dynamically built. It is a static file. Here it is:
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+"
codebase="http://localhost:8085/TestWebApp"
href="ContactEditor.jnlp">
<information>
<title>JNLP Example</title>
<vendor>Catalyst Software</vendor>
<homepage href="http://localhost:8085/TestWebApp" />
<description>JNLP Testing</description>
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.6+" />
<jar href="ContactEditor.jar" />
</resources>
<application-desc main-class="my.contacteditor.ContactEditorUI">
<argument>00001</argument>
<argument>Harish Prasad</argument>
<argument>220153429088</argument>
</application-desc>
<security>
<all-permissions/>
</security>
</jnlp>
Please suggest how to pass arguments dynamically from the servlet to the swing application.
My questions are:
- What code do I have to write at my Swing program?
- What do I have to mention in the JNLP file?
- How should I pass the values from the servlet?