Java 使用Rythm模板引擎过滤标记

Java 使用Rythm模板引擎过滤标记,java,rythm,Java,Rythm,是否可以在中筛选标记 我想在拒绝所有其他标记(尤其是@{})的同时,允许特定标记,如if和for。目前没有过滤机制。然而,Rythm提供了一个名为方言的实用程序,允许模板作者使用Rythm指令的限制集。例如,simplerthm不允许您使用以下指令: "@extends", "@section", "@render", "@inherited", "@doLayout", "@doBody", "@include", "@set", "@get", "@init", "@finally", "@

是否可以在中筛选标记


我想在拒绝所有其他标记(尤其是
@{}
)的同时,允许特定标记,如
if
for

目前没有过滤机制。然而,Rythm提供了一个名为方言的实用程序,允许模板作者使用Rythm指令的限制集。例如,
simplerthm
不允许您使用以下指令:

"@extends",
"@section",
"@render",
"@inherited",
"@doLayout",
"@doBody",
"@include",
"@set",
"@get",
"@init",
"@finally",
"@nosim"
"@args",
"@assign",
"@debug",
"@doLayout",
"@doBody",
"@extends",
"@section",
"@render",
"@inherited",
"@i18n",
"@import",
"@include",
"@invoke",
"@locale",
"@set",
"@get",
"@init",
"@finally",
"@expand",
"@exec",
"@macro",
"@compact",
"@nocompact",
"@def ",
"@tag ",
"@return",
"@nosim",
"@verbatim"
BasicRythm
受到更多限制,您不允许使用以下任何指令:

"@extends",
"@section",
"@render",
"@inherited",
"@doLayout",
"@doBody",
"@include",
"@set",
"@get",
"@init",
"@finally",
"@nosim"
"@args",
"@assign",
"@debug",
"@doLayout",
"@doBody",
"@extends",
"@section",
"@render",
"@inherited",
"@i18n",
"@import",
"@include",
"@invoke",
"@locale",
"@set",
"@get",
"@init",
"@finally",
"@expand",
"@exec",
"@macro",
"@compact",
"@nocompact",
"@def ",
"@tag ",
"@return",
"@nosim",
"@verbatim"
为了使用特定的方言,而不是使用

String result = engine.render(...);
使用以下代码:

ITemplate template = engine.getTemplate(SimpleRythm.INSTANCE, ...);
String result = template.render();

目前无法阻止
@{…}
。请于提交一份申请单,请求配置以禁用Ryth模板中的脚本

更正拼写,添加代码标记并链接到Ryth。