Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Passing arguments/parameters to jnlp over the web. What options are available?

Currently I have an app that is run via JNLP using Java web start. The user is able to hit a specific URL and launch this application just fine.

I'm able to add properties to the JNLP file itself inside of the build.xml (ant web start), by using j2seproperty tags, such as this.

<jw:j2se>

<j2seproperty name="testProperty" value="1"/>

</jw:j2se>

And these properties can be accessed anywhere in code via: System.getProperty("testProperty");

The problem is that I want to be able to set these properties via html, such as the following.

'http://localhost:8080/somelink?testProperty=2'

What are my options for achieving this? I've done some research and so far it seems that the only solution is to somehow dynamically create the JNLP launcher via a servlet of some sort.

Is this correct, and if not, are there other options here? If so, I'm open to all possibilities...

like image 528
csciguy Avatar asked Nov 14 '22 02:11

csciguy


1 Answers

Create the JNLP via a JSP page and have it fill in the property value from the request parameter. See this question for a slightly non-working example, but you should be able to fix it easily enough, I did.

like image 116
user207421 Avatar answered Jan 02 '23 20:01

user207421