thymeleaf 处理模板为字符串

@Autowired
private SpringTemplateEngine thymeleaf;

public String aa() 
{
    Context context = new Context();
    context.setVariable("xx1", "xx1");
    
    return thymeleaf.process("templateName", context);
}
原文地址:https://www.cnblogs.com/white-knight/p/9329732.html