JDK-5054010 : REGRESSION:String values not returned properly from a Java applet to JavaScript
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 5.0
  • Priority: P1
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_2000,windows_xp
  • CPU: x86
  • Submitted: 2004-05-27
  • Updated: 2004-12-21
  • Resolved: 2004-12-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other JDK 6
5.0u2 b04Fixed 6Fixed
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Description
###@###.### 2004-05-27

J2SE Version (please include all output from java -version flag):
  java version "1.5.0-beta2"
  Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta2-b50)
  Java HotSpot(TM) Client VM (build 1.5.0-beta2-b50, mixed mode)


Does this problem occur on J2SE 1.3, 1.4 or 1.4.1?  Yes / No (pick one)
  Works fine with 1.4.1/IE 5.5 & 1.5/Mozilla
  only has this problem with 1.5/IE 5.5

Operating System Configuration Information (be specific):
  Windows 2000 SP4 with IE 5.5, IE 6.0

Bug Description:
  String values are not returned properly from a Java applet to
  JavaScript.   Try to call a native CAPI cert selection dialog if 
  customer is deploying Entrust Truepass for Microsfot CAPI based/ Smart Card
  based login/authentication.   This is specific to using IE with Sun 1.5 JVM.
  Using 1.4.1 with IE, or Mozilla with Sun 1.5 does not exhibit this problem

Example:
JavaScript (calls an applet API method):

        var fileName = null;
            fileName = entrustApplet.selectCertificateName();


Java (applet API method called by JavaScript):

    public static String 
    selectCertificateName()
    throws IOException
    {
        String name = native_selectCertificateName();
        return name;
    }  

Based on our debugging, the value of the filename variable is correct.
However once the call returns to JavaScript the value is invalid. That is,
it is not null, it does not appear to be a string, and it is not undefined.
It does not even appear to be a JavaScript object. Example return string:
"D9D25089C9BC61C0F3BE7A8F2B62C4117D5F5AE1 pki70 test20's Entrust
verification certificate".

Comments
EVALUATION String objects are exposed in JavaScript as a regular Java object. This change was made in b50 so that the user can make use of String APIs on the returned object. This should not affect any of the JavaScript functionality ###@###.### 2004-05-27
27-05-2004