Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calling Java Method from java Script using IE.5(Urgent)

 
faisal khan
Ranch Hand
Posts: 47
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kindly help me in this context as mentioned in subject.

I have Security Provider Jar File, which generates Security Key of data on client side.

We dont face any problems in our desktop based application in Swing.

But we are facing problems in Internet application regarding this issue.

We are using IE.5, we want to generate Key using JavaScript on client side before posting the information on server.

Kindly help me how to call java api using javascript!

We are avoiding to use APPLET? but if no possibilty is there then share info regarding applet communication using javascript.

regards
FI
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may be able to use a technology called LiveConnect to call from JavaScript into a Java applet; the Applets FAQ has some pointers on that.

JavaScript can't call other Java code (like a separately running desktop application).
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to Applets forum, as by necessity an applet will be involved here.
 
Ernesto Leyva
Ranch Hand
Posts: 62
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
IE does not fully support LiveConnect. However
if you declare public member vars and methods
in your applet you should be fine.

For instance
[code]
public class MyApplet extends Applet{

public String title

..... your code to set title

}

Then

<html>
<head>
<script>
function testF(){
alert(myapplet.title);
}
</script>
</head>
<body>
<OBJECT id="myapplet"
classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
width="1" height="1">
<PARAM name="code" value="MyApplet.class">
</OBJECT>
</body>
</html>
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic