info.magnolia.module.templating.renderers
Class ServletTemplateRenderer

java.lang.Object
  extended by info.magnolia.module.templating.AbstractRenderer
      extended by info.magnolia.module.templating.renderers.AbstractTemplateRenderer
          extended by info.magnolia.module.templating.renderers.ServletTemplateRenderer
All Implemented Interfaces:
RenderingModelBasedRenderer, TemplateRenderer

public class ServletTemplateRenderer
extends AbstractTemplateRenderer

Servlet template renderer, mapped to template type servlet. Servlet templates can have a path parameter like the jsp ones (request is forwarded to the specified path), or a className parameter.

If className is set the servlet class will be instantiated and service() will be called (note the servlet will not properly be loaded by the container in this case, so don't rely on other methods except for doGet()/doPost() being called).

Version:
$Revision: 41137 $ ($Author: gjoseph $)
Author:
Fabrizio Giustina

Constructor Summary
ServletTemplateRenderer()
           
 
Method Summary
protected  Map newContext()
          Create a new context object which is a map.
protected  void onRender(Content content, RenderableDefinition definition, Writer out, Map ctx, String templatePath)
          Finally execute the rendering.
 void renderTemplate(Content content, Template template, Writer out)
          Generates the actual output using the selected template.
 
Methods inherited from class info.magnolia.module.templating.renderers.AbstractTemplateRenderer
renderTemplate
 
Methods inherited from class info.magnolia.module.templating.AbstractRenderer
determineTemplatePath, getAggregationStateSafely, getAggrigationStateSafely, getMagnoliaTemplatingUtilities, getMainContentSafely, getPageAttributeName, newModel, render, restoreContext, saveAttribute, saveContextState, setContextAttribute, setupContext, wrapNodeForModel, wrapNodeForTemplate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServletTemplateRenderer

public ServletTemplateRenderer()
Method Detail

renderTemplate

public void renderTemplate(Content content,
                           Template template,
                           Writer out)
                    throws IOException,
                           RenderException
Description copied from interface: TemplateRenderer
Generates the actual output using the selected template.

Specified by:
renderTemplate in interface TemplateRenderer
Overrides:
renderTemplate in class AbstractTemplateRenderer
Throws:
IOException
RenderException

newContext

protected Map newContext()
Description copied from class: AbstractRenderer
Create a new context object which is a map.

Specified by:
newContext in class AbstractRenderer

onRender

protected void onRender(Content content,
                        RenderableDefinition definition,
                        Writer out,
                        Map ctx,
                        String templatePath)
                 throws RenderException
Description copied from class: AbstractRenderer
Finally execute the rendering.

Specified by:
onRender in class AbstractRenderer
Parameters:
content - TODO
Throws:
RenderException


Copyright © 2003-2012 Magnolia International Ltd.. All Rights Reserved.