aboutsummaryrefslogtreecommitdiff
path: root/files/ru/archive/web/liveconnect/index.html
blob: ad74a48f2268a7a5424ef7792528925501d0b15b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
---
title: LiveConnect
slug: Archive/Web/LiveConnect
tags:
  - Java
  - LiveConnect
  - NeedsTranslation
  - TopicStub
translation_of: Archive/Web/LiveConnect
---
<div>
<p><strong>LiveConnect</strong> provides JavaScript with the ability to call methods of Java classes and vice-versa using the existing Java infrastructure.</p>

<p>Older versions of Gecko included special support for the Java&lt;-&gt;JavaScript bridge (such as the <a href="/en-US/docs/LiveConnect_Reference/java" title="/en-US/docs/LiveConnect_Reference/java"><code>java</code></a> and <a href="/en-US/docs/LiveConnect_Reference/Packages" title="/en-US/docs/LiveConnect_Reference/Packages"><code>Packages</code></a> global objects), but as of <a href="/en-US/docs/Mozilla/Firefox/Releases/16" title="/en-US/docs/Mozilla/Firefox/Releases/16">Mozilla 16</a> (Firefox 16 / Thunderbird 16 / SeaMonkey 2.13) LiveConnect functionality is provided solely by the Oracle's Java plugin.</p>
</div>

<table class="topicpage-table">
 <tbody>
  <tr>
   <td>
    <h4 id="Documentation" name="Documentation">Documentation</h4>

    <dl>
     <dt><a href="https://jdk6.java.net/plugin2/liveconnect/" title="https://jdk6.java.net/plugin2/liveconnect/">Java plugin - LiveConnect documentation</a></dt>
     <dd>This is likely the most up-to-date documentation of LiveConnect.</dd>
     <dt>Removal of <code>java</code> and <code>Packages</code> global objects in Mozilla 16</dt>
     <dd>See <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=748343" title='FIXED: remove support for "java" DOM object'>bug 748343</a> for the rationale and workarounds. You can still embed Java applets and access their API from JavaScript.</dd>
     <dt><a href="/en-US/docs/JavaScript/Guide/LiveConnect_Overview" title="en/Core_JavaScript_1.5_Guide/LiveConnect_Overview">LiveConnect Overview</a></dt>
     <dd><small>An overview for Liveconnect.</small></dd>
    </dl>

    <dl>
     <dt><a href="/en-US/docs/LiveConnect/LiveConnect_Reference" title="/en-US/docs/LiveConnect_Reference">LiveConnect reference</a></dt>
     <dd><small>The Java classes used for LiveConnect, along with their constructors and methods.</small></dd>
     <dt><a href="/en-US/docs/Java_in_Firefox_Extensions" title="/en-US/docs/Java_in_Firefox_Extensions"><small>Java in Firefox extensions</small></a></dt>
    </dl>
   </td>
   <td>
    <h4 id="Community" name="Community">Community</h4>

    <ul>
     <li>View mozilla.dev.tech.java forums...</li>
    </ul>

    <p></p><ul>
  <li><a href="https://lists.mozilla.org/listinfo/dev-tech-java">Mailing list</a></li>


  <li><a href="http://groups.google.com/group/mozilla.dev.tech.java">Newsgroup</a></li>
  <li><a href="http://groups.google.com/group/mozilla.dev.tech.java/feeds">RSS feed</a></li>
</ul><p></p>

    <h4 id="Related_Topics" name="Related_Topics">Related Topics</h4>

    <dl>
     <dd><a href="/en/JavaScript" title="en/JavaScript">JavaScript</a>, <a href="/en/Plugins" title="en/Plugins">Plugins</a></dd>
    </dl>
   </td>
  </tr>
 </tbody>
</table>

<h2 id="Older_notes">Older notes</h2>

<p>(Please update or remove as needed.)</p>

<p class="note">While the bloated LiveConnect code in the Mozilla source was removed in version 1.9.2 of the platform (see bug <a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=442399">442399</a>), its former API has been <a class="link-https" href="http://www.oracle.com/technetwork/java/javase/plugin2-142482.html#LIVECONNECT">restored</a> (see also the <a class="link-https" href="http://jdk6.java.net/plugin2/liveconnect/">specification</a> and this <a class="external" href="http://forums.java.net/jive/thread.jspa?threadID=45933&amp;tstart=0">thread</a>) (building on <a href="/en/Plugins" title="en/Plugins">NPAPI</a>?), and as of Java 6 update 12, extensions as well as applets can make use of this restored API. The reimplementation also restores the ability to use try-catch exceptions within JavaScript, and is free of the increasing number of other bugs introduced by the decline of the original LiveConnect (e.g., java.lang.String and arrays not working properly).</p>

<p>LiveConnect use by applets is enabled via the use of the "MAYSCRIPT" attribute in applet tags on an HTML page, following which the applet may refer to classes in the netscape.javascript package to access Javascript objects, and scripts may directly call applet methods (using the syntax document.applets.name.methodName()). Standard Java objects are also available for creation and manipulation by Javascript code (e.g. by writing code like "new java.lang.String('javascript string')" for classes in the java.* package hierarchy, or using a new "Packages" object for classes outside this hierarchy).</p>

<h3 id="Old_LiveConnect_documents_broken_links">Old LiveConnect documents, broken links:</h3>

<dl>
 <dt><a class="external" href="http://www.mozilla.org/js/liveconnect/lc3_method_overloading.html">Java Method Overloading and LiveConnect 3</a></dt>
 <dd><small>The technique that LiveConnect uses to invoke overloaded Java methods from JavaScript.</small></dd>
</dl>

<dl>
 <dt><a class="external" href="http://www.mozilla.org/js/liveconnect/liveconnect-exceptions.html">LiveConnect Exceptions</a></dt>
 <dd><small>How do Java and JavaScript catch exceptions generated by the other party?</small></dd>
</dl>

<dl>
 <dt><a class="external" href="http://www.mozilla.org/quality/browser/front-end/testcases/oji/liveconnecttest.html">Liveconnect Testcases</a></dt>
 <dd><small>Determine that applets within different html tags work properly.</small></dd>
</dl>

<p> </p>

<p>NOTE:</p>

<h3 id="LiveConnect_Blocked_under_Some_Conditions"><a id="lc-block" name="lc-block">LiveConnect Blocked under Some Conditions</a></h3>

<p>LiveConnect calls from JavaScript to Java API are blocked when the Java Control Panel security slider is set to <code>Very High</code> level, or when the slider is at the default <code>High</code> level and the JRE has either expired or is below the <a href="http://www.oracle.com/technetwork/java/javase/7u25-relnotes-1955741.html#securitybaseline-1.7.0_25">security baseline</a>.</p>