cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject svn commit: r1342241 - /cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/java/org/apache/cocoon/stringtemplate/ControllerContextAwareStringTemplateGenerator.java
Date Thu, 24 May 2012 13:03:52 GMT
Author: ilgrosso
Date: Thu May 24 13:03:52 2012
New Revision: 1342241

URL: http://svn.apache.org/viewvc?rev=1342241&view=rev
Log:
Don't loose original parameters with controller-aware-string-template

Modified:
    cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/java/org/apache/cocoon/stringtemplate/ControllerContextAwareStringTemplateGenerator.java

Modified: cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/java/org/apache/cocoon/stringtemplate/ControllerContextAwareStringTemplateGenerator.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/java/org/apache/cocoon/stringtemplate/ControllerContextAwareStringTemplateGenerator.java?rev=1342241&r1=1342240&r2=1342241&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/java/org/apache/cocoon/stringtemplate/ControllerContextAwareStringTemplateGenerator.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/java/org/apache/cocoon/stringtemplate/ControllerContextAwareStringTemplateGenerator.java
Thu May 24 13:03:52 2012
@@ -37,11 +37,17 @@ public class ControllerContextAwareStrin
             throws IOException {
 
         // put all objects that are passed by the controller context
-        final Map<String, Object> controllerContext =
+        Map<String, Object> controllerContext =
                 ControllerContextHelper.getContext(this.parameters);
 
+        if (controllerContext == null || controllerContext.isEmpty()) {
+            controllerContext = this.parameters;
+        } else {
+            // don't loose original parameters
+            controllerContext.putAll(this.parameters);
+        }
+
         return STRenderer.getInstance().render(
                 getTemplate(), controllerContext);
-
     }
 }



Mime
View raw message