> I see your point, but i need to do this because this applet will later
> be used to "monitor" the use of several other applets which are
> simulators. There is about 50 to 100 simulators, each one having its
> own folder "img" for example. I need to separate all those files to
> make sure the final program is clear and clean. That's why i want to
> have different codebases.
You should be able to copy the relevant files in your build process. You
are aware that the same class loaded from a different codebase will be a
different Class?
> Do you think that if i get my applet signed, i'll be able to avoid the
> problem ?
Unless you understand all the security implications of signed code
enough to realise that it's a bad idea, it's a bad idea.
In any case, URLClassLoader.newInstance is what you are looking for.
Tom Hawtin
tekinico - 28 Oct 2006 06:35 GMT
First of all, thank you all for your help/feedback !
> You should be able to copy the relevant files in your build process. You
> are aware that the same class loaded from a different codebase will be a
> different Class?
I don't see how i would be able to do that, the classes i need to load
in this applet are quite random, and i want, in the future to be able
to add more classes to the server that could be accessed the same way
client -----loads-----> monitor -----loads-----> random class
> Unless you understand all the security implications of signed code
> enough to realise that it's a bad idea, it's a bad idea.
I don't know much of security implications about that, i'm quite new in
applets, but it seems not a clean way to do what i want to do, i
confess.
> The advantage of adding the resources
> (other applets, in thise case) to the archives
> attribute/class path is that you can use getResource()
> to discover the URL.
I'll try to use it as well as resources files for the applets i want to
load. But if i archive all my applets one by one, i will have to recode
their access to their own resources. (I precise that these applets are
not programmed by me, they're given to me)
Thank u all