Chunk Home
Full Docs
Filter Docs
GitHub 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
Browse the examples below and enjoy the power of clean, tag-based Chunk templates.
Getting Started
Hello Chunk
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 a list, zebra stripes
Display the 3rd list 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/Throw errors, log 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