方式1:
<input type="button" value="方式1" th:onclick="location='/index'"/>
方式2:
<a th:href="@{/index}">
<input type="button" value="方式2"/>
</a>
方式1:
<input type="button" value="方式1" th:onclick="location='/index'"/>
方式2:
<a th:href="@{/index}">
<input type="button" value="方式2"/>
</a>