|
From: Sells, F. <fr...@ad...> - 2001-10-23 12:17:49
|
I am using jython to customize the behavior of an applet written in Java.
I am loading jython source from a URL and use that source to define 90% of
the appearance of the applet.
I decided to load the source (rather than go the jythonc route) because the
file is much smaller and I have the pazazz (sp?) of being able to modify
applet appearance on the fly. The speed and capability is a big hit with
management.
I read several Jython files and .exec() them in the same instance of the
Interpreter. these files are jython source but the files the client edits
hide that fact. They contain no "class" or "def" statements, nor do they
import anything.
In order to make this work I had to grant permissions to the applet that It
would not normally (default) need. Not a politically acceptable thing to do
in today's world.
I do not know the internals of Jython or Java enough to know if there is a
potential solution for a future release. Things I would consider as a
solution, include:
the ability to "exec()" without requiring a change to applet security
or
the abiltiy to execute conventional C-python (.pyc) byte-code in the
Java environment.
The "big picture" reason to consider such a chage to the core product is
that applets (and webstart) applications can then extend their features with
jython; allowing the core product to be very generic in Java and the
deployed implementation to be customized in Jython.
That's just my opinion, I could be wrong.
Thanks for listening.
Fred Sells
|