基本上,我想将一个JavaScript函数作为回调传递给Java方法。
我可以做到 - 但是我接收到的对象是sun.org.mozilla.javascript.internal.InterpretedFunction,我不知道如何调用它。
有什么想法吗?
这是我目前拥有的:
var someNumber = 0;
function start() {
// log is just an log4j instance added to the Bindings
log.info("started....");
someNumber = 20;
// Test is a unit test object with this method on it (taking Object as a param).
test.callFromRhino(junk);
}
function junk() {
log.info("called back " + someNumber);
}
POST
或GET
请求调用Java,将你的数据作为请求参数传递。 - FK82