Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

LiveConnect in Rhino 1.6R7

9 views
Skip to first unread message

Thomas Weigold

unread,
Aug 27, 2007, 11:26:49 AM8/27/07
to
I'm using ScriptableObject.putProperty() to make a Java object and its
methods visible to scripts. Please not that the class of the Java object is
not defined "public" (only the methods are public) and I don't want it to be
public. This worked fine with Rhino 1.6R4 but now I switched to 1.6R7 and it
doesn't work anymore. It works only if the class is public. Why? Is there
any way to make virtual methods of a Java object visible to scripts without
defining the class/interface to be public?

Thanks, Thomas


David P. Caldwell

unread,
Aug 27, 2007, 11:58:32 AM8/27/07
to

There is an open debate as to whether this should be allowed.

See https://bugzilla.mozilla.org/show_bug.cgi?id=375835

-- David P. Caldwell
http://www.inonit.com/

Norris Boyd

unread,
Aug 27, 2007, 3:45:52 PM8/27/07
to

I'd independently submitted a patch for https://bugzilla.mozilla.org/show_bug.cgi?id=392481
which defines a feature on a ContextFactory that, when enabled, allows
access to non-public members. The feature is disabled by default.

I understand this is a little different from what's requested in
375835, but it highlights the approach of allowing the behavior to be
configured. I don't think this is a one-size-fits-all problem, as
different users will have different needs for security and access.
Certainly someone who is using Rhino for testing Java classes will
have different needs for this feature than someone who is evaluating
scripts from untrusted users on the web.

--Norris

0 new messages