You can use next solution:
@PUT
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
public Response createTask(@FormParam("a") String a, @FormParam("b") String b)
{
final DateTime date = ISODateTimeFormat.basicDate().parse(b);
// ...
basicDate()
has format yyyyMMdd
.
Appropriate format to your case you can find here
EDIT
From Jersey Documentation
In general the Java type of the method parameter may:
Be a primitive type;
Have a constructor that accepts a single String argument;
Have a static method named valueOf or fromString that accepts a single String argument (see, for example, Integer.valueOf(String) and java.util.UUID.fromString(String));
Have a registered implementation of javax.ws.rs.ext.ParamConverterProvider JAX-RS extension SPI that returns a javax.ws.rs.ext.ParamConverter instance capable of a "from string" conversion for the type. or
Be List, Set or SortedSet, where T satisfies 2 or 3 above. The resulting collection is read-only.
So, posssible solutions are 2 and 4.\
Create class ISODateAsString
and use is as parameter
public class ISODateAsString
{
DateTime dateTime;
public DateAsString(String date)
{
dateTime= ISODateTimeFormat.basicDate().parse(date);
}
//...
}
Or use ParamConverterProvider
and ParamConverter