Re: "Proper" way to Access Java from javascript
Brett Zamir <[email protected]> Mon, 03 Dec 2007 13:34:16 +0800
| Newsgroups | gmane.comp.mozilla.devel.java |
|---|---|
| Message-ID | <47539558.3010108__24438.6447863237$1196660120$gmane$org@yahoo.com> |
sam keen wrote:
> Thanks for the .java.policy reference, I'll see if I can get that
> working and then move onto the Java Firefox ext hack as you are.
>
Another tip (though maybe you don't need it as it sounds like you
actually know some Java, unlike me when I started this): use the
following to find out where the user home directory is (where the
.java.policy file should be placed):
alert(java.lang.System.getProperty("user.home"));
or if you prefer to display it on the Java console:
java.lang.System.out.println(java.lang.System.getProperty("user.home"));
By the way, do you (or anyone here) know how dangerous is it to tell
users to add something like the following code (where the jar files
themselves are trusted) to .java.policy:
grant codeBase "file:///C:/Berkeley DB XML 2.3.10/jar/dbxml.jar" {
permission java.security.AllPermission;
};
grant codeBase "file:///C:/Berkeley DB XML 2.3.10/jar/db.jar" {
permission java.security.AllPermission;
};
Also, if anyone can verify my examples from the text at
http://developer.mozilla.org/en/docs/Talk:Java_in_Firefox_Extensions I
think we should add it to the main article... I know that the examples
work for me, but I think it would be good for someone more familiar with
Java to look it over so we can port these examples to the main article
page...
thanks,
Brett