Bonjour,
je suis un tuto JPA. Je bloque sur une erreur.
Ce code marche.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
	@GetMapping(value = "test/produits/{prixLimit}")
	public List<Product> testeDeRequetes(@PathVariable int prixLimit) {
	    return productDao.findByPrixGreaterThan(prixLimit);
	}
Celui ci non
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
 
@GetMapping(value = "test/produits/{recherche}")
    public List<Product> testeDeRequetes(@PathVariable String recherche) {
        return productDao.findByNomLike("%"+recherche+"%");
    }


je me suis dit comme c'est un get aussi et la meme URI, le programme attends un entier en variable d'ou l'erreur?

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
 
	@GetMapping(value = "test/produits/recherche/{recherche}")
    public List<Product> testeDeRequetes(@PathVariable String recherche) {
        return productDao.findByNomLike("%"+recherche+"%");
    }
celui ci ne marche pas non plus, dans mon navigateur, j'ai:
"This application has no explicit mapping for /error, so you are seeing this as a fallback.
Sat Aug 24 13:26:14 CEST 2019
There was an unexpected error (type=Not Found, status=404).
No message available"

Merci.