Can application know the location of its most recent cached *jnlp* file?
Can an application know if it was launched by clicking on the hyperlink in a web page, or whether it was launched from the shortcut on the desktop?
Alternatively, Can the application know the location of its most recent cached *jnlp* file on the desktop?
To take a specific example, let's say I have a word processor, My Word that is deployed using Web Start. It can view documents on the web and must also work offline to view local documents.
When a user clicks the hyperlink to the doc, say,
myParty a href=http://www.MySite.com/myParty.jnlp>Open the myParty document a>
then myParty.jnlp launches My Word, opening the myParty.txt file.
Since there is no way to pass arguments dynamically, one must have a jnlp file for each doc.
So myParty.jnlp has the url of the doc hardcoded in it.
The problem is that apparently Web Start uses the most recent jnlp each time it is launched.
So that if the file has moved, or if one is offline, then the application hangs because it is trying to open the same document, regardless of whether MyWord was launched by clicking on the hyperlink in a web page - in which case this would be appropriate - or whether it was launched from the shortcut on the desktop - inappropriate here.
As a workaround, I was wondering - where is the jnlp file stored on the local desktop?
If the application could find the most recent jnlp, then it could rewrite it (after it was opened the first time) with an identical jnlp that has no application-desc arguments.
Then when the user runs from the shortcut on the desktop, it will launch without a document to open.
Any help appreciated.
Are you planning to kill yourself? Stop! listen to this song
broadband version: http://www.youtube.com/watch?v=pLHHB4YZucI
dial-up version: http://www.youtube.com/watch?v=xL5WyBenUpM