Delete or put methods in thymeleaf

You could use th:method for this:

<form th:object="${commandObject}" th:action="@{/urlToCall}" th:method="delete">

This will generate a hidden input element, which will be picked up by Spring MVC:

<input type="hidden" name="_method" value="delete">

Leave a Comment