diff options
author | Claude Brisson <cbrisson@apache.org> | 2016-07-18 21:20:38 +0000 |
---|---|---|
committer | Claude Brisson <cbrisson@apache.org> | 2016-07-18 21:20:38 +0000 |
commit | bfcb81ab963104a803d2b71b83e3c9429d84074f (patch) | |
tree | 42baeba3b3d923c37504441c1f19d1b98f60b54a /velocity-engine-core/src/main/java/org/apache/velocity/runtime/RuntimeInstance.java | |
parent | 82f8049a31d38df1b5ebfaab37f464cf5438692f (diff) | |
download | apache-velocity-engine-bfcb81ab963104a803d2b71b83e3c9429d84074f.tar.gz |
[engine] add optionl context.autoreference.key property, with testcase
git-svn-id: https://svn.apache.org/repos/asf/velocity/engine/trunk@1753318 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'velocity-engine-core/src/main/java/org/apache/velocity/runtime/RuntimeInstance.java')
-rw-r--r-- | velocity-engine-core/src/main/java/org/apache/velocity/runtime/RuntimeInstance.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/velocity-engine-core/src/main/java/org/apache/velocity/runtime/RuntimeInstance.java b/velocity-engine-core/src/main/java/org/apache/velocity/runtime/RuntimeInstance.java index 908f0606..0a3989b5 100644 --- a/velocity-engine-core/src/main/java/org/apache/velocity/runtime/RuntimeInstance.java +++ b/velocity-engine-core/src/main/java/org/apache/velocity/runtime/RuntimeInstance.java @@ -1410,6 +1410,11 @@ public class RuntimeInstance implements RuntimeConstants, RuntimeServices Object previous = ica.get(evaluateScopeName); context.put(evaluateScopeName, new Scope(this, previous)); } + /** + * optionally put the context in itself if asked so + */ + String self = getString(CONTEXT_AUTOREFERENCE_KEY); + if (self != null) context.put(self, context); nodeTree.render(ica, writer); } catch (StopCommand stop) |