Java Thymeleaf href进入不同页面的内部表单
我正在尝试实现一个“取消”按钮,它会将您带到“主页”。但是,它尝试提交给Java Thymeleaf href进入不同页面的内部表单,java,spring,thymeleaf,Java,Spring,Thymeleaf,我正在尝试实现一个“取消”按钮,它会将您带到“主页”。但是,它尝试提交给表单的th:action中定义的控制器,而不是th:href。有没有办法在不在控制器中定义映射的情况下实现此取消按钮 <form th:action="@{/manageUser}" method="post"> <div> <button type="submit">Submit</button> <a href="index.html" th:hr
表单的th:action
中定义的控制器,而不是th:href
。有没有办法在不在控制器中定义映射的情况下实现此取消按钮
<form th:action="@{/manageUser}" method="post">
<div>
<button type="submit">Submit</button>
<a href="index.html" th:href="@{/}">
<button name="cancel">Cancel</button>
</a>
</span>
</div>
</form>
如果th:href
在表单元素之外,则它可以正常工作如果您坚持使用
元素,请尝试以下操作:
提交
您也可以使用
您只需将按钮类型更改为按钮取消
。它默认为submit@123抢手货我以为默认的是按钮。如果你提交答案,我会接受的。
There was an unexpected error (type=Bad Request, status=400).
Parameter conditions ... not met for actual request parameters