org.melati.template.velocity
Class VelocityServletTemplateEngine
java.lang.Object
org.melati.template.AbstractTemplateEngine
org.melati.template.velocity.VelocityTemplateEngine
org.melati.template.velocity.VelocityServletTemplateEngine
- All Implemented Interfaces:
- ServletTemplateEngine, TemplateEngine
public class VelocityServletTemplateEngine
- extends VelocityTemplateEngine
- implements ServletTemplateEngine
- Since:
- 22 Aug 2007
Methods inherited from class org.melati.template.velocity.VelocityTemplateEngine |
expandedTemplate, expandTemplate, expandTemplate, getEngine, getName, getStringWriter, getTemplateContext, init, loadConfiguration, template, templateExtension |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.melati.template.TemplateEngine |
addRoot, expandedTemplate, expandTemplate, expandTemplate, getEngine, getName, getRoots, getStringWriter, getTemplateContext, getTemplateName, init, template, templateExtension |
VelocityServletTemplateEngine
public VelocityServletTemplateEngine()
- Constructor.
init
public void init(MelatiConfig melatiConfig,
javax.servlet.http.HttpServlet servlet)
throws TemplateEngineException
- Construct a new Engine for use in a servlet environment. For Velocity this
is no different to initialisation outside of a servlets environment.
- Specified by:
init
in interface ServletTemplateEngine
- Parameters:
melatiConfig
- a MelatiConfig
servlet
- the servlet we are within
- Throws:
TemplateEngineException
- if any problem occurs with the engine- See Also:
TemplateServlet
getServletWriter
public MelatiWriter getServletWriter(javax.servlet.http.HttpServletResponse response,
boolean buffered)
- Description copied from interface:
ServletTemplateEngine
- Get a Writer which can write to Servlet output.
- Specified by:
getServletWriter
in interface ServletTemplateEngine
- Parameters:
response
- the HttpServletResponse
that this writer will be
part ofbuffered
- whether the writer should be buffered
- Returns:
- a
MelatiWriter
appropriate for this engine.
getServletTemplateContext
public ServletTemplateContext getServletTemplateContext(Melati melati)
- Get the template context for Velocity, with servlet specific objects added.
- Specified by:
getServletTemplateContext
in interface ServletTemplateEngine
- Parameters:
melati
- the Melati
- Returns:
- a
TemplateContext
Copyright © 2000-2010 PanEris. All Rights Reserved.