You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by eh...@apache.org on 2008/11/18 11:33:17 UTC

svn commit: r718549 - /lucene/solr/trunk/contrib/velocity/src/main/java/org/apache/solr/request/SolrParamResourceLoader.java

Author: ehatcher
Date: Tue Nov 18 02:33:17 2008
New Revision: 718549

URL: http://svn.apache.org/viewvc?rev=718549&view=rev
Log:
Fix bug with getResourceStream method - was returning template name, not template contents.  Added v. prefix to template override parameters

Modified:
    lucene/solr/trunk/contrib/velocity/src/main/java/org/apache/solr/request/SolrParamResourceLoader.java

Modified: lucene/solr/trunk/contrib/velocity/src/main/java/org/apache/solr/request/SolrParamResourceLoader.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/contrib/velocity/src/main/java/org/apache/solr/request/SolrParamResourceLoader.java?rev=718549&r1=718548&r2=718549&view=diff
==============================================================================
--- lucene/solr/trunk/contrib/velocity/src/main/java/org/apache/solr/request/SolrParamResourceLoader.java (original)
+++ lucene/solr/trunk/contrib/velocity/src/main/java/org/apache/solr/request/SolrParamResourceLoader.java Tue Nov 18 02:33:17 2008
@@ -42,8 +42,8 @@
     while (names.hasNext()) {
       String name = names.next();
       
-      if (name.startsWith("template.")) {
-        templates.put(name.substring(9) + ".vm",params.get(name));
+      if (name.startsWith("v.template.")) {
+        templates.put(name.substring(11) + ".vm",params.get(name));
       }
     }
   }
@@ -53,7 +53,7 @@
 
   public InputStream getResourceStream(String s) throws ResourceNotFoundException {
     String template = templates.get(s);
-    return template == null ? null : new ByteArrayInputStream( s.getBytes() );
+    return template == null ? null : new ByteArrayInputStream(template.getBytes());
   }
 
   public boolean isSourceModified(Resource resource) {