1

みたいなことができるようになりたい

// 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 ファイルに固定する必要があります。テンプレートを動的にロードできますか?

4

1 に答える 1