1、使用bsh(一个开源包)
private Interpreter beanShell = new Interpreter();
beanShell.eval("import avax.servlet.http.HttpServletRequest;");
beanShell.set("request", (HttpServletRequest) pageContext.getRequest());
beanShell.eval("Object o = request.getValue" + name);
Object value = beanShell.get("o");
3、JEP(一个开源包)
类的动态调用和表达式求值(原创)
最新推荐文章于 2023-01-29 15:35:05 发布