The @DefaultValue
represents a default value for a form parameter, query parameter, cookie, and a few others, as described in the javadoc. These various parameters and values are sent as part of the request. The http server receives them as Strings and your jax-rs container parses them and converts them appropriately. @DefaultValue
provides the value as a string and let's the container convert it as it would with a provided value.
So just provide the string representation of the int
value and the container will make the correct conversion