colomb
colomb

Reputation: 318

java webstart redownloads jnlp when query string is present in url

I'm using tomcat to serve up webstart applications. I've got a servlet writing out a jnlp based on the url sent to tomcat to allow for argument passing to the main. When requesting the jnlp without a query string, I see tomcat serve up the jnlp once, but as soon as I add a query string to the url, I see tomcat serving up the jnlp twice:

0:0:0:0:0:0:0:1 - - [08/Nov/2012:09:10:44 -0600] "GET /javastart/testapp.jnlp HTTP/1.1" 200 2062

vs.

0:0:0:0:0:0:0:1 - - [08/Nov/2012:09:01:48 -0600] "GET /javastart/testapp.jnlp?56 HTTP/1.1" 200 2103
127.0.0.1 - - [08/Nov/2012:09:01:48 -0600] "GET /javastart/testapp.jnlp HTTP/1.1" 200 2062

If I remove the href attribute of the jnlp element, this does not happen. This leads me to believe that webstart is requesting the jnlp file again for some reason. Is this a correct? If so, why?

Upvotes: 4

Views: 323

Answers (1)

colomb
colomb

Reputation: 318

I couldn't find solid documentation on this, but it appears this is closely related to the href attribute of the jnlp tag and how webstart ensures it has the latest jnlp. If the url in the generated jnlp does not match the url used for the initial request, webstart will request the jnlp again using the url from the jnlp tag from the jnlp it just downloaded. In our setup, the href attribute in the jnlp tag was static and wasn't being generated to match the attributes being passed in the query string. Since the jnlp url given webstart was different that the url it found in the jnlp, it requested the jnlp again but without the query string.

Upvotes: 1

Related Questions