Dear Kevin,
I guess all related information can be found in: 
http://www.mozilla.org/rhino/tutorial.html
Simply, you can do something like the below Java code.
On the other hand, I am curious by your GWT statement, isn't it meant to handle 
the JS, and you don't worry about RPC at all?
Hope that helps,
Ahmed
--------------------
  Context cx = ContextFactory.getGlobal().enterContext();
  try {
   final String s = "your js code";
   Scriptable scope = cx.initStandardObjects();
   cx.evaluateString(scope, s, "<cmd>", 1, null);
   Object functionArgs[] = {"hello", "there"};
   Object fObj = scope.get("function_name", scope);
   final NativeFunction f = (NativeFunction) fObj;
   Object result = f.call(cx, scope, scope, functionArgs);
   System.out.println(result);
  }
  finally {
   Context.exit();
  }
--------------------


----- Original Message ----
From: Kevin R. VanDenBreemen <[EMAIL PROTECTED]>
To: [email protected]
Sent: Wednesday, July 16, 2008 5:18:12 PM
Subject: The Basics

I've been googling around for a while, looking at Rhino's examples,
etc, and I am rather puzzled by the tool.  I was hoping that it was
something that could simply (without jargon) do the following within
the context of a Java program:

1.  Take a javascript source F
2.  Given a function n() defined in F and an argument set S, execute
n(S)

But instead there is a lot of discussion about executing scripts from
the commandline, compiling scripts into classfiles whose source cannot
be obtained, etc.

Am I missing something here?

Really I am interested in trying to use Rhino for something like
executing the RPC calls in GWT applications.  Can it do that?
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino



      
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to