users@jersey.java.net

RE: [Jersey] Default value for Set or List QueryParam when no values are given

From: Rabick, Mark A (IS) <"Rabick,>
Date: Fri, 8 May 2009 14:21:43 -0500

regarding collection types mapped to a @QueryParam
 
>4. Be List<T>, Set<T> or SortedSet<T>, where T satisfies 2 or 3 above.
The resulting collection is read-only.
 
How is the list/set parsed from the query parameter?? does it
split(',') or split(';') or is there some way to specify a delimiter?
 
I can't find how List vs. Set vs. Sorted Set behave, just that they are
valid parameters to annotate with QueryParam.
 
-mark

_______________________________________________
Mark A. Rabick - Software Engineer
Em: mark.rabick_at_ngc.com

 


________________________________

        From: Paul.Sandoz_at_Sun.COM [mailto:Paul.Sandoz_at_Sun.COM]
        Sent: Friday, May 08, 2009 10:55 AM
        To: users_at_jersey.dev.java.net
        Subject: Re: [Jersey] Default value for Set or List QueryParam
when no values are given
        
        

        On May 7, 2009, at 7:51 PM, Stephen Duncan Jr wrote:


                The documentation (for instance, the Javadocs on
DefaultValue) say that I should get an empty collection if I don't
specify the a @DefaultValue annotation, and if no params are provided:
"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, null for other object types, and the Java-defined
default for primitive types."
                
                I am getting null instead. This is with jersey-1.0.3.
                
                


        I verified this is a problem, well found. Can you log an issue?

        Thanks,
        Paul.