【发布时间】:2019-11-26 23:35:31
【问题描述】:
我正在尝试显示从 Corda 节点接收到的进度跟踪器信息。我在 Springboot 控制器/Thymeleaf 中使用ReactiveDataDriverContextVariable 设置为控制器模型的属性,但它不起作用,它只显示我的变量的地址。
我已经尝试过site 中的教程
我的控制器看起来像(我设法从 Progresss tracker observable 创建了一个Flux,myFlux)
public String index(final Model model) {
// loads 1 and display 1, stream data, data driven mode.
IReactiveDataDriverContextVariable reactiveDataDrivenMode =
new ReactiveDataDriverContextVariable(myFlux, 100);
model.addAttribute("progressTracker", reactiveDataDrivenMode);
return "index";
}
我的百里香叶视图
<table id="Progress" class="table table-striped">
<thead>
<tr>
<th width="70%">Step</th>
</tr>
</thead>
<tbody>
<tr class="result" data-th-each="step: ${progressTracker}">
<td>[[${step}]]</td>
</tr>
</tbody>
</table>
【问题讨论】:
-
您能否为您的问题提供更多背景信息?你能展示一下progresstracker 类以及你是如何获得这种通量的吗?在渲染方面您期望什么行为(网页应该立即渲染还是应该长期存在的进度信息?)
标签: spring-boot thymeleaf corda spring-webflux