Ich möchte die URL über http löschen Methode aufrufen. Ich versuchte th: onclick und th: action aber nicht funktioniert.Thymeleaf - Button klicken, um http löschen Methode
HTML-Code:
<button id="delete" name="delete" th:onclick="@{'/foos/{id}'(id=${foo.id})}" th:method="delete">Delete</button>
Controller-Code:
@RequestMapping(value="/foos/{id}", method = RequestMethod.DELETE)
@ResponseBody
public String delete(@PathVariable String id) {
studentService.delete(id);
return "Successfully deleted";
}
Hilft Ihnen die Antwort? – Patrick