Applet.getCodeBase () returns null for local applets since Java 7 update 25

Since Java 7 is Update 25 , the Applet getCodeBase() method returns NULL for local applets. I did not find anything in the Java 7u25 release notes that would announce / explain this change, but I found an e-mail discussion that states that the change is really intended.

Can someone help me find a resource / documentation where I could find out more about this change?

+4
source share
3 answers

Release Notes:

http://www.oracle.com/technetwork/java/javase/7u25-relnotes-1955741.html

him there.

"Local applets return NULL for"

+2
source

UPDATE (1/21/2014): Java update 51 seems to fix this Java error

Oracle claims that the fix was security related and was necessary to prevent an isolated applet from accessing "file path" information (the name of the folder in which the applet is running). But Oracle failed, as explained in great detail here:

http://www.duckware.com/tech/java-security-clusterfuck.html

Google "java bug report" and submit the bug report to Oracle.

+2
source

Oracle Error # 8017250 (which appears to be related to Failed to debug applet with JDK 7u21 and 7u25 ) has more details. In particular, it states that it is β€œnot a problem” (ie, intentional) and offers the following alternatives:

If the applet needs to download the resource:

  • If the resource is in JAR (s) applets, they should be able to directly load its ClassLoader.getResoruceAsStream , without requiring codebase information.
  • If the resource is in a harsh location, and not inside the JAR applet, they should have other ways to get to this place, since it is not part of the applet resource. (for example, user.home java system property, provided that their applet has all access rights)
0
source

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