org.melati.template.velocity
Class VelocityServletTemplateEngine

Package class diagram package VelocityServletTemplateEngine
java.lang.Object
  extended by org.melati.template.AbstractTemplateEngine
      extended by org.melati.template.velocity.VelocityTemplateEngine
          extended by org.melati.template.velocity.VelocityServletTemplateEngine
All Implemented Interfaces:
ServletTemplateEngine, TemplateEngine

public class VelocityServletTemplateEngine
extends VelocityTemplateEngine
implements ServletTemplateEngine

Since:
22 Aug 2007

Field Summary
 
Fields inherited from class org.melati.template.velocity.VelocityTemplateEngine
NAME
 
Fields inherited from class org.melati.template.AbstractTemplateEngine
roots
 
Constructor Summary
VelocityServletTemplateEngine()
          Constructor.
 
Method Summary
 ServletTemplateContext getServletTemplateContext(Melati melati)
          Get the template context for Velocity, with servlet specific objects added.
 MelatiWriter getServletWriter(javax.servlet.http.HttpServletResponse response, boolean buffered)
          Get a Writer which can write to Servlet output.
 void init(MelatiConfig melatiConfig, javax.servlet.http.HttpServlet servlet)
          Construct a new Engine for use in a servlet environment.
 
Methods inherited from class org.melati.template.velocity.VelocityTemplateEngine
expandedTemplate, expandTemplate, expandTemplate, getEngine, getName, getStringWriter, getTemplateContext, init, loadConfiguration, template, templateExtension
 
Methods inherited from class org.melati.template.AbstractTemplateEngine
addRoot, getRoots, getTemplateName
 
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
 

Constructor Detail

VelocityServletTemplateEngine

public VelocityServletTemplateEngine()
Constructor.

Method Detail

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 of
buffered - 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.