简体   繁体   English

如何将两个参数传递给百里香模板?

[英]How to pass two parameters to a thymeleaf template?

i have a Thymeleaf template for email, and I am trying to pass two parameters to create an URL. 我有一个用于电子邮件的Thymeleaf模板,并且我试图传递两个参数来创建URL。

The part I am talking about looks like this: 我正在谈论的部分看起来像这样:

<p><span>To accept the protocol click <a th:href="@{http://localhost:8080/accept/(invoiceId=${invoiceId}),(contractorEmail=${email})">HERE</a></span></p>

When I run the function that should create and send an email, I get: 当我运行应创建并发送电子邮件的功能时,我得到:

Could not parse as expression: "@{http://localhost:8080/accept/(invoiceId=${invoiceId}),(contractorEmail=${email})" (template: "mailTemplate" - line 7, col 47)

How can I pass both parameters to the URL? 如何将两个参数都传递给URL?

这全部记录在Thymeleaf的标准URL语法中

@{http://localhost:8080/accept/(invoiceId=${invoiceId},contractorEmail=${email})}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM