Package org.javalite.activeweb
Class TemplateManager
java.lang.Object
org.javalite.activeweb.TemplateManager
- Direct Known Subclasses:
FreeMarkerTemplateManager
- Author:
- Igor Polevoy
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
Same asmerge(java.util.Map, String, String, String, java.io.Writer, boolean customRoute)
, but uses default layout and default format (html).abstract void
merge(Map<String,Object> values, String templateName, String layout, String format, Writer writer, boolean customRoute)
Merges values with templates and writes a merged template to the writer.protected String
Session ID from underlying session, or null if session does not exist.abstract void
setServletContext(javax.servlet.ServletContext ctx)
A template manager might need a context to be able to load templates from it.abstract void
setTemplateLocation(String templateLocation)
-
Constructor Details
-
TemplateManager
public TemplateManager()
-
-
Method Details
-
merge
public abstract void merge(Map<String,Object> values, String templateName, String layout, String format, Writer writer, boolean customRoute)Merges values with templates and writes a merged template to the writer.- Parameters:
values
- values to be merged.templateName
- name of template in format:dir/template
without file extension. This is to support multiple template technologies in the future.writer
- Writer to write results to.customRoute
- true if the route is custom. In this case, the template manager will not try to guess a template name based on a formatlayout
- name of layout,null
if no layout is needed.
-
merge
public abstract void merge(Map<String,Object> values, String template, Writer writer, boolean customRoute)Same asmerge(java.util.Map, String, String, String, java.io.Writer, boolean customRoute)
, but uses default layout and default format (html). -
setServletContext
public abstract void setServletContext(javax.servlet.ServletContext ctx)A template manager might need a context to be able to load templates from it.- Parameters:
ctx
- servlet context
-
setTemplateLocation
- Parameters:
templateLocation
- this can be absolute or relative.
-
sessionId
Session ID from underlying session, or null if session does not exist.
-