THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
By default there isn't much you have to do to use the new compilation abilities in OGNL. Following is an example of compiling a simple property expression and invoking it.
Code Blocknoformat |
---|
SimpleObject root = new SimpleObject();OgnlContext context = (OgnlContext) Ognl.createDefaultContext(null); Node node = (Node) Ognl.compileExpression(context, root, "user.name");String userName = node.getAccessor().get(context, root); |