cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gkossakow...@apache.org
Subject svn commit: r557274 - /cocoon/whiteboard/objectmodel/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/components/expression/jxpath/JXPathExpression.java
Date Wed, 18 Jul 2007 14:26:42 GMT
Author: gkossakowski
Date: Wed Jul 18 07:26:41 2007
New Revision: 557274

URL: http://svn.apache.org/viewvc?view=rev&rev=557274
Log:
COCOON-2085: If there is more than one context bean only last added should be used.

Modified:
    cocoon/whiteboard/objectmodel/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/components/expression/jxpath/JXPathExpression.java

Modified: cocoon/whiteboard/objectmodel/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/components/expression/jxpath/JXPathExpression.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/objectmodel/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/components/expression/jxpath/JXPathExpression.java?view=diff&rev=557274&r1=557273&r2=557274
==============================================================================
--- cocoon/whiteboard/objectmodel/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/components/expression/jxpath/JXPathExpression.java
(original)
+++ cocoon/whiteboard/objectmodel/cocoon-expression-language/cocoon-expression-language-impl/src/main/java/org/apache/cocoon/components/expression/jxpath/JXPathExpression.java
Wed Jul 18 07:26:41 2007
@@ -25,6 +25,7 @@
 import org.apache.cocoon.components.expression.ExpressionException;
 import org.apache.cocoon.components.expression.jexl.JSIntrospector;
 import org.apache.cocoon.util.jxpath.NamespacesTablePointer;
+import org.apache.commons.collections.ArrayStack;
 import org.apache.commons.jxpath.CompiledExpression;
 import org.apache.commons.jxpath.JXPathContext;
 import org.apache.commons.jxpath.Pointer;
@@ -132,7 +133,11 @@
     private JXPathContext getContext(ObjectModel objectModel) {
         // This could be made more efficient by caching the
         // JXPathContext within the Context object.
-        JXPathContext jxobjectModel = JXPathContext.newContext(objectModel.get(ObjectModel.CONTEXTBEAN));
+        
+        Object contextBean = objectModel.get(ObjectModel.CONTEXTBEAN);
+        if (contextBean instanceof ArrayStack)
+            contextBean = ((ArrayStack) contextBean).peek();
+        JXPathContext jxobjectModel = JXPathContext.newContext(contextBean);
         jxobjectModel.setVariables(new VariableAdapter(objectModel));
         jxobjectModel.setLenient(this.lenient);
         //FIXME



Mime
View raw message