1. Whitelabel Error Page Error occurs when the Page submits the DELETE request
<button th:attr="del_uri=@{/emp/}+${emp.id}" class="btn btn-sm btn-danger deleteBtn">Del</button>
<form id="deleteEmpForm" method="post">
<input type="hidden" name="_method" value="delete"/>
</form>
<script>
$(".deleteBtn").click(function(){
$("#deleteEmpForm").attr("action",$(this).attr("del_uri")).submit();
return false;
});
</script>
solution
You only need to configure [Application.Properties] in the SpringBoot configuration:
spring.mvc.hiddenmethod.filter.enabled=true