From 8d2d6b24e0b029d295bac121883278409f390a42 Mon Sep 17 00:00:00 2001 From: Erik Hatcher Date: Tue, 18 Nov 2008 10:33:17 +0000 Subject: [PATCH] Fix bug with getResourceStream method - was returning template name, not template contents. Added v. prefix to template override parameters git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@718549 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/solr/request/SolrParamResourceLoader.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/velocity/src/main/java/org/apache/solr/request/SolrParamResourceLoader.java b/contrib/velocity/src/main/java/org/apache/solr/request/SolrParamResourceLoader.java index 908225f7845..73064f54002 100644 --- a/contrib/velocity/src/main/java/org/apache/solr/request/SolrParamResourceLoader.java +++ b/contrib/velocity/src/main/java/org/apache/solr/request/SolrParamResourceLoader.java @@ -42,8 +42,8 @@ public class SolrParamResourceLoader extends ResourceLoader { 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 class SolrParamResourceLoader extends ResourceLoader { 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) {