下面是伪代码
public void testImportInContext() {
ParserContext ctx = new ParserContext();
ctx.addImport("List", List.class);
ctx.addImport("ArrayList", ArrayList.class);
MVEL.eval("List test = null;User u =null", ctx);
}
发生异常
- [Error: could not access: List; in class: org.mvel2.ParserContext]
- [Near : {... List test = null;User u =null ....}]