I think you can just bind the QueryParam to be an int and have JAX-RS do this.