|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TemplateService
Provides a templating service interface.
VelocityTemplateService
.
However you can instruct Click to use a different implementation by adding
the following element to your click.xml configuration file.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <click-app charset="UTF-8"> <pages package="org.apache.click.examples.page"/> <template-service classname="org.apache.click.extras.service.FreemarkerTemplateService"> </click-app>
Method Summary | |
---|---|
void |
onDestroy()
Destroy the TemplateService. |
void |
onInit(ServletContext servletContext)
Initialize the TemplateService with the given application configuration service instance. |
void |
renderTemplate(Page page,
Map<String,?> model,
Writer writer)
Render the given page to the writer. |
void |
renderTemplate(String templatePath,
Map<String,?> model,
Writer writer)
Render the given template and model to the writer. |
Method Detail |
---|
void onInit(ServletContext servletContext) throws Exception
ConfigService
by invoking
ClickUtils.getConfigService(javax.servlet.ServletContext)
servletContext
- the application servlet context
Exception
- if an error occurs initializing the Template Servicevoid onDestroy()
void renderTemplate(Page page, Map<String,?> model, Writer writer) throws IOException, TemplateException
page
- the page template to rendermodel
- the model to merge with the template and renderwriter
- the writer to send the merged template and model data to
IOException
- if an IO error occurs
TemplateException
- if template error occursvoid renderTemplate(String templatePath, Map<String,?> model, Writer writer) throws IOException, TemplateException
templatePath
- the path of the template to rendermodel
- the model to merge with the template and renderwriter
- the writer to send the merged template and model data to
IOException
- if an IO error occurs
TemplateException
- if template error occurs
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |