Subj : Call self defined java class in JS by Rhino To : netscape.public.mozilla.jseng From : Jiming Liu Date : Fri Dec 03 2004 01:53 pm This is a multi-part message in MIME format. ------=_NextPart_000_0024_01C4D93F.702D4AC0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi, Can anybody tell me why I have the extended from ScriptableObject and defined jsConstructor_*, jsGet_*, jsSet_*, jsFunction_* when I simply want to use the a self defined Java class? It is boring, especially when the class has a lot of methods. I think Jyphon do it more elegent. 1) define class; package com.pushtotest.myapplication; public class myApp { public String getName() { return "Frank"; } } 2)call in Jyphon from com.pushtotest.myapplication import myApp a = myApp() print "myApp says: Thank you", a.getName(), \ ", I will buy a support agreement." Look, much easier and more decent, right? Can anyone tell me how to use Rhino in this way or why Rhino do not support this way? Great thanks! Jiming ------=_NextPart_000_0024_01C4D93F.702D4AC0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
Hi,
Can anybody tell me why I have the extended =
from
ScriptableObject and defined jsConstructor_*, jsGet_*, jsSet_*, =
jsFunction_*
when I simply want to use the a self defined Java class? It is boring,
especially when the class has a lot of methods. =
I think Jyphon do it more elegent. =
1) define class;
package = com.pushtotest.myapplication;
public class = myApp
{ =
i> &nbs=
p; public String getName() &nbs=
p; { &nbs=
p; return =
"Frank"; &nbs=
p; }} =
i>2)call in Jyphon
from com.pushtotest.myapplication =
import myAppa =3D =
myApp()print "myApp says: = Thank you", a.getName(), \
", I will = buy a support agreement."
Look, much easier and more decent, =
right?
Can anyone tell me how to use Rhino in this =
way or why
Rhino do not support this way?
Great thanks!
Jiming