Click to See Complete Forum and Search --> : how to call java methods inside javascript


summiboy
10-27-2003, 06:30 AM
I'm trying to call a java method inside JavaScript.
The core constructors or methods could be used whereas a user-defined method couldnt be.

This works --> "var temp = new Packages.java.lang.Long(10); document.writeln(temp);"

But the following doesnt work --> " var tmp = new Packages.myclasses.myconstructor(); "
where "myconstructor" is an own class inside package "myclasses"

Can anyone help me in setting the classpath correctly to the user-defined classes in this case.
Waiting eagerly for a reply,
regards
Summiboy

pelegk1
10-27-2003, 06:45 AM
i didnt see any 1 here handle tht problem

if u find answer tell us about it

Khalid Ali
10-27-2003, 07:48 AM
Originally posted by pelegk1
i didnt see any 1 here handle tht problem


You did not look hard enough...

to answer summiboy's question

your browser knows where the code clases are thats why you can access them.I bet if you put your user defined classes in the lib folder of the JRE used in your OS browser will or should recognise them.

You will need to look in registr to see which is your JRE version..Or
for Window 2k

C:\Program Files\Java\the highest nimber jre\lib\classes here

pandi
02-07-2008, 07:41 AM
hi,

can you please explain how the user defined classes can be added??

i tried the thing u quoted but there is no folder or file like 'classes here'
so i am not able to call my java method. kindly help on this. but there is one file called classes list, in that classes are listed like 'java/util/vector' so we cant add like java/myPackage/myClass. so please explain.

thanks in advance.