Skip to main content

Can application know the location of its most recent cached *jnlp* file?

1 reply [Last post]
anilp1
Offline
Joined: 2006-03-20

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.

http://www.MySite.com/myParty.doc

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.
thanks,
Anil Philip
_________________
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

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
anilp1
Offline
Joined: 2006-03-20

1) To make it more complicated, it seems that the browser also does the caching.
2) I could not find the jnlp as a file on the desktop, so I suspect that is stored in some database. Is there any way the application can write to it *or any api to simply allow the application to change the arguments*?
3) It is not an option to use jnlpservlet as the document can be placed anywhere and not just on a webserver under our control.