title: Jersey Joda Time ISO 8601 parameter in urlencoded form
body: <p>I am using Jersey: 1.17.1 and defined a REST service accepting "application/x-www-form-urlencoded". I would like to accept a parameter "b" in ISO-8601 format and let Jersey map this to a Joda DateTime.</p>
  
  <pre><code>@PUT
  @Produces(MediaType.APPLICATION_JSON)
  @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
  public Response createTask(@FormParam("a") String a, @FormParam("b") DateTime b) {
  ...
  </code></pre>
  
  <p>but I am getting this exception</p>
  
  <pre><code>SEVERE: The following errors and warnings have been detected with resource and/or provider classes:
  SEVERE: Missing dependency for method public de.ast.mae.rest.util.response.Response de.ast.mae.rest.service.tasks.TasksAdminRestService.createTask(java.lang.String,org.joda.time.DateTime) at parameter at index 6
  SEVERE: Missing dependency for method public de.ast.mae.rest.util.response.Response de.ast.mae.rest.service.tasks.TasksAdminRestService.createTask(java.lang.String,org.joda.time.DateTime) at parameter at index 6
  SEVERE: Method, public de.ast.mae.rest.util.response.Response de.ast.mae.rest.service.tasks.TasksAdminRestService.createTask(java.lang.String,java.lang.String,org.joda.time.DateTime), annotated with PUT of resource, class de.ast.mae.rest.service.tasks.TasksAdminRestService, is not recognized as valid resource method.
  Okt 09, 2013 5:54:41 PM com.sun.jersey.spi.spring.container.servlet.SpringServlet initiate
  SEVERE: Exception occurred when intialization
  com.sun.jersey.spi.inject.Errors$ErrorMessagesException
  at com.sun.jersey.spi.inject.Errors.processErrorMessages(Errors.java:170)
  at com.sun.jersey.spi.inject.Errors.postProcess(Errors.java:136)
  </code></pre>
  
  <p>What do I need to do to make this work?</p>
  
  <p><strong>And the answer is:</strong> I first upgraded to JAX-RS 2.0 and then used: </p>
  
  <pre><code>@Provider
  public class DateTimeParamConverterProvider implements ParamConverterProvider {
  
      @Override
      public &lt;T&gt; ParamConverter&lt;T&gt; getConverter(Class&lt;T&gt; type, Type genericType, Annotation[] annotations) {
          if (type.equals(DateTime.class)) {
              return (ParamConverter&lt;T&gt;) new DateTimeParamConverter();
          } else {
              return null;
          }
  
      }
  
      private static class DateTimeParamConverter implements ParamConverter&lt;DateTime&gt; {
          @Override
          public DateTime fromString(String value) {
              try {
                  return ISODateTimeFormat.dateTimeNoMillis().parseDateTime(value);
              } catch (IllegalArgumentException e) {
                  return ISODateTimeFormat.dateTime().parseDateTime(value);
              }
          }
  
          @Override
          public String toString(DateTime value) {
              return value.toString();
          }
  
      }
  }
  </code></pre>