Hi John, "John C. Turnbull" <[email protected]> wrote on 04/24/2009 05:32:11 AM:
> This is what I suspected. However, it is possible to use the > defineClass() method of the class ClassLoader which takes a byte[] > so I would have thought that would be possible in an applet. I > realise that it would be a problem if the byte codes are saved to > disk before being loaded by the class loader but if the compilation > can be done in memory, why is it a problem? I'm not quite so certain as you that you can just call defineClass. However, I suggest you ask the Rhino folks, you have reached the end of my understanding of the issue. The Rhino API requires that we supply a classloader that implements one of their interfaces - so we need a custom class loader which is forbidden in an Applet. If you discover that it is possible to compile scripts in an applet please let us know what is involved. > > Thanks, > > John > > From: [email protected] [mailto:[email protected]] > Sent: Friday, 24 April 2009 19:21 > To: [email protected] > Cc: [email protected] > Subject: Re: Script compilation in Batik applets > > > Hi John, > > "John C. Turnbull" <[email protected]> wrote on 04/24/2009 04:01:35 AM: > > > I believe that JavaScript scripts are not able to be compiled when > > Batik is run in an applet. Why is this? Is it because Rhino can?t > > do it for some reason > > Yes > > > or does it have something to do with the way Batik uses it? > > No > > When Rhino compiles scripts it generates Java Byte codes and > then loads those bytecodes via a custom classloader. Custom > classloaders are forbidden in an Applet context.
