jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1425682 - /jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/servlets/SimpleVelocity.java
Date Mon, 24 Dec 2012 21:08:07 GMT
Author: andy
Date: Mon Dec 24 21:08:07 2012
New Revision: 1425682

URL: http://svn.apache.org/viewvc?rev=1425682&view=rev
Log:
Velocity requires a mutable map so use Velocity allocated one.

Modified:
    jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/servlets/SimpleVelocity.java

Modified: jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/servlets/SimpleVelocity.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/servlets/SimpleVelocity.java?rev=1425682&r1=1425681&r2=1425682&view=diff
==============================================================================
--- jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/servlets/SimpleVelocity.java
(original)
+++ jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/servlets/SimpleVelocity.java
Mon Dec 24 21:08:07 2012
@@ -47,7 +47,12 @@ public class SimpleVelocity
         velocity.setProperty(RuntimeConstants.INPUT_ENCODING, "UTF-8") ;
         velocity.setProperty(RuntimeConstants.FILE_RESOURCE_LOADER_PATH, base) ;
         velocity.init() ;
-        VelocityContext context = new VelocityContext(params) ;
+        
+        // Velocity requires a mutable map.
+        VelocityContext context = new VelocityContext() ;
+        for ( Map.Entry<String, Object> e : params.entrySet() )
+            context.put(e.getKey(), e.getValue()) ;
+        
         try {
             Template temp = velocity.getTemplate(path) ;
             temp.merge(context, out) ;



Mime
View raw message