Dust is Java-based web framework built around components, templates and JAX-RS.
Quick start or read Getting started
Dust lets you combine a page
@Path("/hello")
@Template
public class HelloPage {
private String name;
@GET
public HelloPage get(@QueryParam("name") @DefaultValue("Unknown") String name) {
this.name = name;
return this;
}
public String getName() { return name; }
}
with a template
<!DOCTYPE html>
<html>
<head>
<title>Hello ${name}!</title>
</head>
<body>
Hello ${name}! Your name is ${name.length()} characters.
</body>
</html>
which would then be accessible at /hello.
Templates can reference components
<body xmlns:d="dust:common">
<d:if test="${name == 'Cookie monster'}">
Your name is awesome!
</d:if>
</body>
can easily be localized
<body xmlns:m="dust:messages">
${m:hello} ${name}!
</body>
// TemplateClass.messages - defaults
hello=Hello
// TemplateClass.sv.messages - Swedish
hello=Hej
and come with a great expression language
<link href="${app:asset('style.css')}" rel="stylesheet" type="text/css" />
<a href="/${d:urlencode(name.trim())}">${name}</a>
<span d:if="${name.length() lt 5 and name.length() gt 2}">${m:name} ${name}</span>