You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@velocity.apache.org by nb...@apache.org on 2007/11/09 22:59:27 UTC
svn commit: r593666 -
/velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/VelocityViewServlet.java
Author: nbubna
Date: Fri Nov 9 13:59:27 2007
New Revision: 593666
URL: http://svn.apache.org/viewvc?rev=593666&view=rev
Log:
re-introduce handleRequest() for BC's sake (though deprecated of course)
Modified:
velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/VelocityViewServlet.java
Modified: velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/VelocityViewServlet.java
URL: http://svn.apache.org/viewvc/velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/VelocityViewServlet.java?rev=593666&r1=593665&r2=593666&view=diff
==============================================================================
--- velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/VelocityViewServlet.java (original)
+++ velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/VelocityViewServlet.java Fri Nov 9 13:59:27 2007
@@ -200,7 +200,7 @@
setContentType(request, response);
// get the template
- Template template = getTemplate(request, response);
+ Template template = handleRequest(request, response, context);
// merge the template and context into the response
mergeTemplate(template, context, response);
@@ -213,6 +213,28 @@
{
requestCleanup(request, response, context);
}
+ }
+
+
+
+ /**
+ * <p>This was a common extension point, but has been deprecated.
+ * It has no single replacement. Instead, you should override
+ * {@link #fillContext} to add custom things to the {@link Context}
+ * or override a {@link #getTemplate} method to change how
+ * {@link Template}s are retrieved</p>
+ *
+ * @param request client request
+ * @param response client response
+ * @param ctx VelocityContext to fill
+ * @deprecated This will be removed in VelocityTools 2.0.
+ * @return Velocity Template object or null
+ */
+ protected Template handleRequest(HttpServletRequest request,
+ HttpServletResponse response,
+ Context ctx) throws Exception
+ {
+ return getTemplate(request, response);
}
protected Context createContext(HttpServletRequest request,