Prevent Java Applet Class Loader from attempting to remotely search for classes

I noticed that when the Java applet is executed, the class loader seems to get to the web server with a literal stream of requests for material that should already be in the jar applet file, or something that it does not need. Classes, property files, BeanInfo for each class in the applet, you name it. It seems that this is actually completely deliberate, apparently it is assumed that it allows you to update individual files in the bank without replacing the entire bank - therefore, the class loader first tries to remotely retrieve the file, and only if this fails, it will allow the local copy to be used already there is.

I find it very annoying and wasteful, the web server continues to clog useless requests that it should deny. There is no way to invert the default behavior, that is, tell the class loader to first use the local copy and only once when the desired resource is not found locally, try to extract it remotely? Would it be too much to hope that there might be some kind of system property that I just need to set, or do I really need to write a loader for the replacement class to accomplish this?

+4
source share
1 answer

Files must first be read from archives. To disable the search for files that should fail, there is an option for this:

<PARAM name="codebase_lookup" value="false"> 

http://download.oracle.com/javase/6/docs/technotes/guides/plugin/developer_guide/special_attributes.html#codebase

+4
source

Source: https://habr.com/ru/post/1335412/


All Articles