Comments (2)
我知道原因了。。。addFunctionOfServiceMethod必须放在addMacro前面。。要么调用不到。。我原来写反过来的。。
from qlexpress.
String sum = "function sum(int a,int b){\n" +
" return a+b;\n" +
"};\n";
runner.addMacro("bbb", sum);
runner.addFunctionOfServiceMethod("add", new BindObjectMethod(), "add",
new Class[] { Integer.class, Integer.class }, null);
DefaultContext<String, Object> context = new DefaultContext<String, Object>();
String express = "add(1,2);bbb;sum(1,22)";
Object r = runner.execute(express, context, null, true, false);
System.out.println(r);
通过这种方式利用addMacro替换成函数,执行时报错说sum(1,22) sum函数找不到,请问是什么问题?谢谢
from qlexpress.
Related Issues (20)
- 字符串拼接 无法使用 \ 进行拼接吗
- 使用java stream 如果集合属性是一个jsonObject,在使用put方法时 报错 HOT 1
- 脚本中定义function时, function中的变量不是局部变量 HOT 1
- 高精度计算精度丢失的问题
- getOutAttrNames返回有错误 HOT 1
- ExpressLoader#loadExpress不允许更新表达式 HOT 1
- Caused by: java.lang.StackOverflowError HOT 2
- QLExpress最新版本(3.3.1)默认不安全,存在命令注入 HOT 4
- 指令集的缓存优化 HOT 1
- 【咨询】请问有完整的语法bnf吗? HOT 1
- 浮点数科学计数法解析失败
- QL 3.3.1 规则判断与3.20存在一定的差异 HOT 1
- 短路计算有Bug HOT 1
- 请问下 qlexpress怎么使用自定义的classloader HOT 1
- 我想运行期间增加自定义函数,这样就存在要卸载以前的函数,我看api 中未提供卸载,同时如果一个函数存在在此添加就会出现异常,能否判断内容是否变化如果变化 HOT 2
- 脚本中定义function,导致内存泄漏 HOT 2
- 默认的in 操作符有BUG,返回不满足期望 HOT 3
- 只支持in 不支持not in HOT 1
- Like 操作符 空指针异常 HOT 1
- 3.3.1版本,可利用白名单机制绕过黑名单实现命令注入
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qlexpress.