I have the data information, such as names, prices, etc; in a static memory, when I call them in the browser they only appear if they are written exactly as they are in the repository; my doubt is how to ignore the tildes and capital letters.
@PostMapping("/buscar")
public String buscarLibro(@RequestParam String nombre, Model model) {
Collection<Libros> libros = librosService.findAll().stream().filter(p ->
p.getNombre().contains(nombre)).collect(Collectors.toList());
model.addAttribute("bLibros",libros);
return "/Libreria/listar";
}
If you don't want to complicate your life you can use the apache commons-lang3 library, it has a class called StringUtils that solves your problem easily
To avoid further case-sensitive problems you can add toLowerCase to convert everything to lowercase.
dependency on maven
And in addition to this you can try the vanilla java class although it's a bit less elegant, but you don't use the library