Skip to main content

Can SAME application be from 2 different URL

6 replies [Last post]
rb5563
Offline
Joined: 2008-06-12

My understanding is the URL (or codebase) controls how the javaws client side determines whether two applications are the same. Using DownloadServlet this is a problem because if people spell the host differently (e.g. "foo" versus "foo.com" versus an IP address) they get 3 different copies of the application.

But even without $$codebase it is a problem because I want to have a Production and a LAB and a Failover system. These systems are identical. When users use these three systems (at different permanent URLs) I want them to only get ONE copy of each of many javaws applications, not 3 of each.

Other than having only one functioning download host (which kind of defeats the purpose of LAB and Failover), I don't see how to control this.

Is that accurate? Or am I missing a way to make them stay one application on the client?

Thanks, RB

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
mthornton
Offline
Joined: 2003-06-10

Yes that is my understanding. If you want failover, you have to do it behind a common URL.

rb5563
Offline
Joined: 2008-06-12

This article (search for second appearance of href)
http://java.sun.com/developer/community/askxprt/sessions/2006/jl0410.jsp
claims it is a unique href or main class that makes a unique application.
I wish that conversation was a forum because I would like proof. Omitting the href does not make it one application. The questioner of course was looking to do the opposite, but the inferred meaning is clear enough. Btw, Codebase in 6u10 is also supposed to be optional. I get an error. I don't think it will change anything anyway, because I believe Java Web Start fills in the absolute codebase from the URL anyway, exactly the same way $$codebase in JnlpDownloadServlet does.

mthornton
Offline
Joined: 2003-06-10

There are security implications in allowing items to be loaded from multiple locations (i.e. with different URLs). One possible approach:

For item the JNLP file would contain a unique URI that identified the item, a list of URLs where it could be found and crucially the signer (public key) that is used to sign all the copies. Then the key for the cache would be the URI plus signer.

To allow a JNLP file to be located in multiple places, it would also have to be signed.

If the cache already contains a matching item (on URI and signer), then it doesn't matter if it was downloaded from a URL not listed by the current JNLP file.

Take JavaHelp for example. The jar file is already signed by Sun. Any number of webstart applications could then reference this resource and provided they gave the same URI, the jar file could be shared amongst them all.

rb5563
Offline
Joined: 2008-06-12

There are no security issues.

Let me clarify. This is not a question about downloading different parts of one application from different URLs (other than codebase).

This is about downloading the identical application twice, from two different (but identical) servers, and having javaws recognize they are the same.

The above posting from Sun says it can be done. I say that post is wrong, as I have tried every combination, and javaws keeps them independent.

As for the desktop shortcut, if the names are the same, one will overwrite the other (since they are just a file with the same name), and you will end up with a shortcut to whatever came last.

So that post is again wrong on that front, i.e. you cannot make "separate" applications by changing the href, since the questioner in that post wanted separate shortcuts. They will be separate applications (in the cache), but only the last shortcut will remain (unless of course you change the filename of the shortcut) [which is derived by the title is it not, not the href or main-class name as that post implies].

Apologies in advance for saying people are wrong, if it is I who is completely wrong about things, which wouldn't be the first time.

Thanks... RB

mthornton
Offline
Joined: 2003-06-10

> Let me clarify. This is not a question about
> downloading different parts of one application from
> different URLs (other than codebase).
>
> This is about downloading the identical application
> twice, from two different (but identical) servers,
> and having javaws recognize they are the same.
Surely you want to avoid the second download and not merely overwrite the existing cache location? For most people the redundant download time is more important than saving a bit of disk space. For an application you also want to avoid a duplicate icon/application in the start menu.

rb5563
Offline
Joined: 2008-06-12

I would be very happy to not do the download again. If this worked, I kind of expect it would not do the download again. But since I see no way to control this, the question of whether it does a 2nd unncessary download is not ripe.

As I said, contrary to the Sun post, duplicate shortcuts are not an issue. You can not create them if you want them, nor create them by accident when you don't. They are just Windows files. If the file name is the same, they will overwrite each other, and you will end up with only the last one created. You will not get two (regardless of whether you wanted two or didn't want two).

... RB