de.fuberlin.wiwiss.pubby.servlets
Class VelocityHelper
java.lang.Object
de.fuberlin.wiwiss.pubby.servlets.VelocityHelper
public class VelocityHelper
- extends java.lang.Object
A facade class that simplifies using a custom Velocity
engine from a servlet. It encapsulates creation of the
VelocityEngine instance, its storage in the servlet
context, and the rendering of templates into the
servlet response output stream.
Constructor Summary |
VelocityHelper(javax.servlet.ServletContext servletContext,
javax.servlet.http.HttpServletResponse response)
|
Method Summary |
org.apache.velocity.context.Context |
getVelocityContext()
|
void |
renderXHTML(java.lang.String templateName)
Renders a template using the template variables put into the velocity context. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
VelocityHelper
public VelocityHelper(javax.servlet.ServletContext servletContext,
javax.servlet.http.HttpServletResponse response)
getVelocityContext
public org.apache.velocity.context.Context getVelocityContext()
- Returns:
- A receptacle for template variables
renderXHTML
public void renderXHTML(java.lang.String templateName)
- Renders a template using the template variables put into the velocity context.