我希望能够做一些像
这样的事情// 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文件中,我可以动态加载它们吗?
答案 0 :(得分:1)