Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General 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
  • 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
Posts: 42967
73
  • 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: 24211
35
Chrome Eclipse IDE Mac OS X
  • 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
  • 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>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic