cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin (JIRA)" <>
Subject [jira] Commented: (CXF-2986) sets null instead of empty List/Set/SortedSet when value isn't in query string
Date Mon, 13 Sep 2010 21:21:33 GMT


Sergey Beryozkin commented on CXF-2986:


I'm tempted to close this JIRA as 'won't fix'.

There's some ambiguity there with respect to handling query parameters, but the thing is that
a query like

if we have for example

@QueryParam("option") String option

then given a query like


we should an empty String, as the value of the 'option' parameter.

'Null' means the query was not there while an empty value means there was a query parameter
but without the usual name=value.

?option may not be the best example, but if we have something like


and get a null then it means there was no _wadl query...

Does it make sense or do you disagree ? We may need to ask a question in the jaxrs users list.
I definitely did get an answer regarding an emty value representing a query where only a key
is available. 

thanks, Sergey

> sets null instead of empty List/Set/SortedSet when value isn't in query string
> ------------------------------------------------------------------------------
>                 Key: CXF-2986
>                 URL:
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.2.10
>            Reporter: Brad Cupit
>            Priority: Minor
> CXF sets a null collection, rather than an empty one, when the query param isn't in the
> Example:
>     @GET
>     @Path("/stuff")
>     public Response get(@QueryParam("option") Set<String> options) { ... }
> and http://localhost:8080/stuff is called (but ?option=abc is not on the query string),
then options will be null, but it should be an empty Set
> The javadocs in @DefaultValue says:
> If this annotation is not used and the corresponding metadata is not present in the request,
the value will be an empty collection for List, Set or SortedSet
> this seems similar to CXF-1675

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message