Well, my problem is that I do not know how to declare a variable in thymeleaf and that it recognizes me spring with @Pathvariable. I leave the methods of the html and the controller. Thanks
This is the controller:
@GetMapping(value = "/testing/{username}")
public String test2 (@PathVariable (value ="username") String user , Model model ) {
model.addAttribute("titulo", user);
return "testing";
}
The html
<div class="form-group col-sm-6">
<input type="text" name="username" id="username"
class="form-control" placeholder="UserName" autofocus required th:whith ="username "/>
</div>