Chunk Home
Full Docs
Filter Docs
GitHub Project Page
SourceForge Project Page
Chunk Templates for Java
The clean, intuitive way to generate HTML.
Or XML. Or plain text documents. Or...
Get Chunk 3.6.2
Look over the examples below and enjoy the power of clean, tag-based Chunk templates.
Getting Started
Hello Chunk 2.4
Tag pass-through
Set output for undefined tags
Nestable if - elseif - else
Loop in a list/array
Loop in an object's attributes
Include another template
Exec - execute macros
Dump all available tags
Template from Strings (no files)
Bind pojo/bean data to template
Fun with Tag Filters
Uppercase, Lowercase
Regular Expressions (RegEx)
Format numbers with sprintf
Escaping and unescaping
Add 20 pixels
Indent five spaces
Join an array, zebra stripes
Display the 3rd array element
Hashing filters and base64
Is tag value a list/object?
Write your own filter
Advanced Examples
Layered Inheritance
Localization and translations
Templates from different folder
Hide errors, route to STDERR
Literal blocks
Loop in DB query results
Write your own filter
Write your own custom .tag
Trigger custom code, db fetch
Load templates from the 'net
Load templates on Android