[Jersey] Re: _at_DefaultValue with empty string

From: kenglxn <>
Date: Wed, 6 Apr 2011 04:59:57 -0700 (PDT)

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
Perhaps this empty field check could be conditionally invoked only if the
value is a primitive type?

View this message in context:
Sent from the Jersey mailing list archive at