I have an JaxRS API like this :
@GET
@Path("list")
public Response list(@QueryParam("id") Long id) {
...
}
How can i handle exception when send non digits parameter as id ?
actually i can not found any validation annotation on JakartaEE framework for handle this problem .
example request :
curl http://localhost:8080/api/list?id=ABCD
NOTE: I won't change Long to String .
You should add validate annotation after @QueryParam: