From 57c70675d347c48af625c110e6c1ab01ea3f14f1 Mon Sep 17 00:00:00 2001 From: Erik Hatcher Date: Thu, 13 Nov 2008 02:03:48 +0000 Subject: [PATCH] Add EscapeTool into context, allowing url, html, and other escaping capabilties git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@713614 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/solr/request/VelocityResponseWriter.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contrib/velocity/src/main/java/org/apache/solr/request/VelocityResponseWriter.java b/contrib/velocity/src/main/java/org/apache/solr/request/VelocityResponseWriter.java index ae4d309f022..c7e1447fe28 100644 --- a/contrib/velocity/src/main/java/org/apache/solr/request/VelocityResponseWriter.java +++ b/contrib/velocity/src/main/java/org/apache/solr/request/VelocityResponseWriter.java @@ -20,6 +20,7 @@ package org.apache.solr.request; import org.apache.solr.common.util.NamedList; import org.apache.velocity.Template; import org.apache.velocity.VelocityContext; +import org.apache.velocity.tools.generic.EscapeTool; import org.apache.velocity.app.VelocityEngine; import java.io.File; @@ -38,6 +39,7 @@ public class VelocityResponseWriter implements QueryResponseWriter { context.put("request", request); context.put("response", response); context.put("page",new PageTool(request,response)); + context.put("esc", new EscapeTool()); template.merge(context, writer); }