lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ehatc...@apache.org
Subject svn commit: r718549 - /lucene/solr/trunk/contrib/velocity/src/main/java/org/apache/solr/request/SolrParamResourceLoader.java
Date Tue, 18 Nov 2008 10:33:17 GMT
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) {



Mime
View raw message