Solve the problem that the delete request is not available under SpringBoot. There was an unexpected error (type=Method Not Allowed, status=405).


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

Read More: