问一下,这个方法,android怎么调用并传参?在此多谢大神
这几个参数(用户名,密码,原密码)是req.body.xxx。这怎么传参啊?一般都是像下面这样调用的:ScriptEngineManagermanager=newScri...
这几个参数(用户名,密码,原密码)是req.body.xxx。这怎么传参啊?一般都是像下面这样调用的:
ScriptEngineManager manager = new ScriptEngineManager();
ScriptEngine engine = manager.getEngineByName("javascript");
String jsFileName = "xxx.js"; // 读取js文件
FileReader reader = new FileReader(jsFileName);
engine.eval(reader);
if(engine instanceof Invocable) {
Invocable invoke = (Invocable)engine;
// 调用js中的xxx方法,并传入两个参数2和3
Double c = (Double)invoke.invokeFunction("xxx", 2, 3);
//打印结果System.out.println("c = " + c); 展开
ScriptEngineManager manager = new ScriptEngineManager();
ScriptEngine engine = manager.getEngineByName("javascript");
String jsFileName = "xxx.js"; // 读取js文件
FileReader reader = new FileReader(jsFileName);
engine.eval(reader);
if(engine instanceof Invocable) {
Invocable invoke = (Invocable)engine;
// 调用js中的xxx方法,并传入两个参数2和3
Double c = (Double)invoke.invokeFunction("xxx", 2, 3);
//打印结果System.out.println("c = " + c); 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询