Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This document is meant as a development/integration guide for anyone wanting to use the new OGNL 2.7 features for doing byte code runtime enhancements on OGNL statements.  This is not meant for general user reference as it covers what are mostly internal API development concerns.

 Basic Usage

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 Block

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);