0
下面使用ParserContext.addImport是僞代碼錯誤的位置在MVEL
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 ....}]
非常感謝。 –