<dependencies>
<dependency>
<groupId>org.scalatra.scalate</groupId>
<artifactId>scalate-core_2.12</artifactId>
<version>1.9.6</version>
</dependency>
</dependencies>
html
<!DOCTYPE html>
<html>
<head>
<title>Hello Scalate!</title>
</head>
<body>
<h1>Hello, ${name}!</h1>
</body>
</html>
import org.fusesource.scalate.TemplateEngine;
import org.fusesource.scalate.Template;
import java.util.HashMap;
import java.util.Map;
public class ScalateExample {
public static void main(String[] args) {
TemplateEngine engine = new TemplateEngine();
Template template = engine.load("path/to/hello.ssp");
Map<String, Object> model = new HashMap<>();
model.put("name", "Scalate");
String output = engine.layout(template, model);
System.out.println(output);
}
}