WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
UNCONFIRMED
20177
LiveConnect does not work returning arrays from Java applet to JavaScript
https://bugs.webkit.org/show_bug.cgi?id=20177
Summary
LiveConnect does not work returning arrays from Java applet to JavaScript
steve lindholm
Reported
2008-07-25 18:15:43 PDT
I am having trouble returning arrays of strings from a Java applet to JavaScript on Safari 3.1.2. It works fine on Firefox 3.0.1. Here's the documentation on how it's supposed to work:
http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Guide:LiveConnect_Overview:Data_Type_Conversions:JavaScript_to_Java_Conversions
http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Guide:LiveConnect_Overview:Data_Type_Conversions:Java_to_JavaScript_Conversions
Here's are two simple files demonstrating the problem. Compile test19.java with javac test19.java. Under firefox, you will see two diagnostic alerts followed by "Success!" On Safari the diagnostics will be obviously wrong and then the script will halt. test19.html: <html> <head> <title>tests whether applets can return string arrays</title> </head> <script type="text/javascript"> function clicker () { var arr; arr = document.test19.test (); alert (typeof arr); alert (arr.toString ()); if (arr[0] == "foo" && arr[1] == "bar") alert ("success!"); else alert ("failure!"); } </script> <body> <button onclick="clicker ()">Write Config</button> <applet name="test19" code="test19.class" width="1" height="1" mayscript></applet> </body> </html> test19.java: import java.applet.Applet; public class test19 extends Applet { public void init () { } public void start () { } public void stop () { } public void destroy () { } public String [] test () { String [] ret = new String[2]; ret[0] = "foo"; ret[1] = "bar"; return ret; } }
Attachments
html file for testcase
(501 bytes, text/html)
2008-07-25 18:18 PDT
,
steve lindholm
no flags
Details
java file for testcase
(290 bytes, text/plain)
2008-07-25 18:19 PDT
,
steve lindholm
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
steve lindholm
Comment 1
2008-07-25 18:18:05 PDT
Created
attachment 22490
[details]
html file for testcase
steve lindholm
Comment 2
2008-07-25 18:19:40 PDT
Created
attachment 22491
[details]
java file for testcase
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug