<?xml version="1.0" encoding="UTF-8"?> <chunk-templates version="1.0"> <template-path>/path/to/templates</template-path> <cache-enabled>true</cache-enabled> <cache-timeout>3600</cache-timeout> <optimization-enabled>true</optimization-enabled> <debug-enabled>false</debug-enabled> </chunk-templates> import dev.chunk.template.*; import dev.chunk.template.renderer.*; public class ViewLayer { public static void main(String[] args) { ChunkEngine engine = new ChunkEngine("chunk-config.xml"); ChunkTemplate template = engine.getTemplate("template.html"); ChunkContext context = new ChunkContext(); context.setVariable("name", "World"); String output = template.render(context); System.out.println(output); } }


上一篇:
下一篇:
切换中文