public static void main(String[] args) {
SpringTemplateEngine engine = new SpringTemplateEngine();
StringTemplateResolver resolver = new StringTemplateResolver();
engine.setTemplateResolver(resolver);
Map<String,Object> params = new HashMap<>();
params.put("name","测试");
Context context = new Context();
context.setVariables(params);
String process = engine.process("[(${name})]",context);
System.out.println(process);
}
网友评论