英文:
Exception rendering qute template
问题
我正在尝试在方法内渲染一个 qute 模板:
@ResourcePath("myTpl")
Template tpl;
void generate(Order order) {
tpl.data("order", order).render();
}
模板文件:
{@org.acme.Order order}
<html>
...
{#for orderProduct in order.getProducts()}
<tr>{orderProduct.getPrice()}</tr>
{/for}
...
</html>
我面临的问题是:
[error]: Build step io.quarkus.qute.deployment.QuteProcessor#analyzeTemplates threw an exception: java.lang.IllegalArgumentException: Not a virtual method: *(orderProduct
<details>
<summary>英文:</summary>
I am trying to render a qute template inside a method:
```java
@ResourcePath("myTpl")
Template tpl;
void generate(Order order) {
tpl.data("order", order).render();
}
The template file:
{@org.acme.Order order}
<html>
...
{#for orderProduct in order.getProducts()}
<tr>{orderProduct.getPrice()}</tr>
{/for}
...
</html>
The issue that I am facing:
[error]: Build step io.quarkus.qute.deployment.QuteProcessor#analyzeTemplates threw an exception: java.lang.IllegalArgumentException: Not a virtual method: *(orderProduct
Thanks.
答案1
得分: 0
理想情况下,请提交一个新的问题并附上一个最小的重现案例。别忘了提到 Quarkus 版本。顺便说一句,您应该能够使用 {#for orderProduct in order.products}
和 {orderProduct.price}
(无需参数 -> 无需使用括号)。
英文:
Ideally, file a new issue and attach a minimal reproducer. And don't forget to mention the Quarkus version. BTW you should be able to use {#for orderProduct in order.products}
and {orderProduct.price}
instead (no param -> no need to use the parentheses).
专注分享java语言的经验与见解,让所有开发者获益!
评论