I have the following link
<div class="col-md-8">
<a href="borrarUsuario/${session.userData.id}">Borrar Usuario</a>
</div>
This is the controller method that clears
@RequestMapping(value="/borrarUsuario/{id}",method = RequestMethod.POST)
public String borrarUsuario(@RequestParam("id") Long id){
repoUsuario.delete(id);
return "views/_t/main";
}
Class UsuarioRepository
extends from JpaRepository
What I can not do is delete the user by id
.
SOLUTION:
The problem was that I did not take the value of id
, so I looked for it in this way if I took it without having to parsed the variable.
<div class="col-md-8">
<a th:href="@{'/borrarUsuario/' + ${session.userData.id}}">Borrar Usuario</a>
</div>