Let's say there is a url accepting an integer parameter named "param".
@Path("/foo/")
public Response getFoo(@QueryParam("param") Integer param)
{ ...... }
If I make a call like this -> /foo/?param=aa (using string value instead of integer), it throws http status code 500 and not 400 since the input seems wrong.
What's the best way to make sure it throws 400, since it is, in fact, bad request?