【发布时间】:2017-11-27 20:29:34
【问题描述】:
我是 Spring MVC 的初学者,我犯了一些错误……所以我想用一个按钮和 Thymeleaf 伪造一个动态 URL,但它不起作用。我考虑转义引号或类似的, ${key} 在评估中不正确?
<tr th:each="key: ${serverBean.getServerB().keySet()}">
<td>
<span th:text="${serverBean.getServerB().get(key)}" />
</td>
<td align="center">
<span th:text="${key}" />
</td>
<td th:if="${protoStatusBean.getStatus(key)}" bgcolor="lime" />
<td th:unless="${protoStatusBean.getStatus(key)}" bgcolor="red"/>
<td>
<button th:onclick="window.location.href='/update?server=${key}'">
<img src="./images/wrench.png" height="15" width="15">
</button>
</td>
</tr>
感谢您的帮助和耐心
【问题讨论】:
标签: spring-mvc thymeleaf