|
||||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | |||||||||
See:
Description
| Interface Summary | |
|---|---|
| JspNode | Root node for the JSP elements |
| Class Summary | |
|---|---|
| Main | Util class to test the template engine. |
| Template | This class is used to execute a template. |
| Exception Summary | |
|---|---|
| TemplateException | TemplateException, thrown when there is an error while running a template. |
Provides a JSP based templating engine. The template looks like a JSP file, but the code written within the JSP tags can be JavaScript. An example template is given below:
/**
* This is a test header - <%="hi there"%>
* create on <%=new java.util.Date()%>
*/
public class TestClass {
public void someOtherMethod<%="()"%>{
<% for(i=0; i<10; i++) { %>
System.out.println("hi there"); <%}%>
}
}
Template template = new Template();
//set up implicit variables
template.setProperty("name", value);
String templateFileName = ... //name of the template file
String outputFile = ... //name of the file to the generated
//exec the template
template.exec(templateFileName, outputFile);
|
||||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | |||||||||