动态加载模板文件到Rythm? (没有目录设置)

时间:2016-04-17 22:00:11

标签: java template-engine rythm

我希望能够做一些像

这样的事情
// be able to replace this section
Map<String, Object> map = new HashMap<>();
map.put("home.template", "resources"); // foo.html and bar.html (foo invoke bar)
Rythm.init(map);
System.out.println(Rythm.render("foo.html", "World"));

// with this section
Rythm.put("foo.html", fooTemplateStr);//dynamically add/replace foo.html to template repository
Rythm.put("bar.html", barTemplateStr);//dynamically add/replace bar.html to template repository
System.out.println(Rythm.render("foo.html", "World"));

我正在构建一个简单的博客引擎,允许用户通过Web界面设置/更改模板。但是我需要使用Rythm将模板修复到目录或jar文件中,我可以动态加载它们吗?