org.melati.app
Class TemplateApp
java.lang.Object
org.melati.app.AbstractConfigApp
org.melati.app.AbstractPoemApp
org.melati.app.AbstractTemplateApp
org.melati.app.TemplateApp
- All Implemented Interfaces:
- App
public class TemplateApp
- extends AbstractTemplateApp
An example of how to use a Template Engine with a Poem database
from the command line.
Invoke:
java -cp melati.jar:site\properties:lib\hsqldb.jar: \
lib\webmacro.jar:lib\servlet.jar \
org.melati.app.TemplateApp poemtest user 0 \
org/melati/app/TemplateAppExample
Where poemtest is your database, user is your table, 0 is the record id and
org/melati/app/TemplateAppExample is the full name of a template.
From within Maven try:
org.codehaus.mojo
exec-maven-plugin
generate
test
java
org.melati.app.TemplateApp
mydb
mytable
mytroid
mytemplate
-output
${basedir}/src/main/webapp/WEB-INF/web.xml
true
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TemplateApp
public TemplateApp()
doTemplateRequest
protected String doTemplateRequest(Melati melati,
TemplateContext templateContext)
throws Exception
- The main method to override.
- Specified by:
doTemplateRequest
in class AbstractTemplateApp
- Parameters:
melati
- A Melati
with arguments and properties settemplateContext
- A TemplateContext
containing a Melati
- Returns:
- the name of a template to expand
- Throws:
Exception
- if anything goes wrong- See Also:
(org.melati.Melati, org.melati.template.ServletTemplateContext)
main
public static void main(String[] args)
throws Exception
- The main entry point.
- Parameters:
args
- in format db table troid method
where method is a template name
- Throws:
Exception
Copyright © 2000-2010 PanEris. All Rights Reserved.