Daniel Larsson wrote:
>
> What about this case then?
>
> @GET @Path("/")
> public String foo(@QueryParam("bar") @DefaultValue("baz") String bar) {
> ...
> }
>
> I'd be surprised and annoyed if this caused bar to contain "baz" when
> calling it with "GET /?bar=". Don't send parameters if you don't intend to
> give a value.
>
>
I agree.
For non-primitive types you actually get through to the resource.
The issue is only relevant for primitive types that fail in the valueOf
call.
Perhaps this empty field check could be conditionally invoked only if the
value is a primitive type?
--
View this message in context: http://jersey.576304.n2.nabble.com/DefaultValue-with-empty-string-tp5657597p6245761.html
Sent from the Jersey mailing list archive at Nabble.com.