Issue using RESTful Web Service Test tool

I am using the Restful Web Service Test tool. I need to POST a FormParam which is a list of String like so:

     @POST

     @Produces("text/plain")

     @Consumes(MediaType.APPLICATION_FORM_URLENCODED)

     public String setTargetCollections(@FormParam("targetCollectionIdList") final List<String> targetCollectionList) {


     .....

     }

I don't see a way to do this with the tool. After selecting POST from the HTTP Method drop down I edited the Request Parameters tab. In the Request Parameters section there does not seem to be support for adding a list of parameters. If I try to enter the same parameter name on two different lines it automatically removes the duplicate one.

I am using Jersey 1.1.5 on Glassfish v3 with JDK 1.6_20 on Windows. The documentation for FormParameter says:

The type T  of the annotated parameter must either:

   1. Be a primitive type
   2. Have a constructor that accepts a single String argument
   3. Have a static method named valueOf that accepts a single String argument (see, for example, Integer.valueOf(String))
   4. Be List<T>, Set<T> or SortedSet<T>, where T satisfies 2 or 3 above. The resulting collection is read-only."

I am trying to use #4. An example of HTML which should populate it looks like so:

<form action="rest/resource method="POST">
    <label >Target Collection 1</label><input name="targetCollectionIdList" />
    <br/>
    <label >Target Collection 2</label><input name="targetCollectionIdList" />
    <br/>
    <label >Target Collection 3</label><input name="targetCollectionIdList" />
    <br/>
       
    <input type="submit" value="Submit" />
</form>


Is this a bug or am I am I missing something in using the tool?

Thanks,

-Noah

Please sign in to leave a comment.