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

Java-to-Javascript conversion fails for null Object property within a JavaObject

2 views
Skip to first unread message

John Irish

unread,
Jun 19, 2001, 10:42:35 PM6/19/01
to
I am having problems with the Java-to-Javascript conversion of null Objects
exposed as public properties within a JavaObject when using the JavaSoft JRE
plug-in 1.3. Problem does not occur with browser's built-in JVM. Any
insight into this problem would be appreciated.

----------------------------

Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0_02)
Java HotSpot(TM) Client VM (build 1.3.0_02, mixed mode)

Test environment is Microsoft IE 5.5. Problem occurs when running applet
with
JRE plug-in and does not occur when using browser's built-in JVM.

Problem occurs when a public Java method within an Applet returns an Object
which contains public property Objects which may be null. In the example
below, if obj is an Object which contains a public property "date" Object,
if
date is null an error will occur. The expression (typeof obj.date)
evaluates
to "unknown" which prevents any assignment, comparison, or passing of the
object within JavaScript.

var obj = myApplet.getObj();
if (obj.date != null) doSomething();

The comparison statement above produces an "Unspecified Error", Code: 0.

0 new messages