Java:将多个值传递给handlebar模板
我使用手柄模板,以准备电子邮件内容动态发送之前,它 只传递一个值很简单。例如:Java:将多个值传递给handlebar模板,java,handlebars.java,Java,Handlebars.java,我使用手柄模板,以准备电子邮件内容动态发送之前,它 只传递一个值很简单。例如: What's up{{{this}}template与template.apply(firstName)配合得很好 尝试将模板更改为What's up{{{this}},{{{this}}并尝试通过template.apply(lastName)填充和模板。应用(名字) 但是它不起作用。您必须通过名称引用在此对象上设置的变量 What's up {{firstName}}, {{lastName}} 将贴图作为参数
What's up{{{this}}
template与template.apply(firstName)
配合得很好
尝试将模板更改为What's up{{{this}},{{{this}}
并尝试通过template.apply(lastName)填充代码>和模板。应用(名字)代码>
但是它不起作用。您必须通过名称引用在此
对象上设置的变量
What's up {{firstName}}, {{lastName}}
将贴图作为参数传递
模板.hbs
What's up {{firstName}}, {{lastName}}
controll.java
template.apply(new HashMap<String, Object>() {
{
put("firstName", "Himanshu");
put("lastName", "Yadav");
}
});
template.apply(新的HashMap(){
{
put(“名”、“希曼殊”);
put(“lastName”、“Yadav”);
}
});
车把
不是那样工作的。你介意详细解释一下你的回答吗?handlebar.java和handlebar.js有什么不同吗?