我有一个用于电子邮件的Thymeleaf模板,并且我试图传递两个参数来创建URL。
我正在谈论的部分看起来像这样:
<p><span>To accept the protocol click <a th:href="@{http://localhost:8080/accept/(invoiceId=${invoiceId}),(contractorEmail=${email})">HERE</a></span></p>
当我运行应该创建并发送电子邮件的功能时,我得到:
Could not parse as expression: "@{http://localhost:8080/accept/(invoiceId=${invoiceId}),(contractorEmail=${email})" (template: "mailTemplate" - line 7, col 47)
如何将两个参数都传递给URL?
答案 0 :(得分:2)
这全部记录在Thymeleaf的Standard URL Syntax中。
@{http://localhost:8080/accept/(invoiceId=${invoiceId},contractorEmail=${email})}