Thanks, that did the trick. I didn't have time to follow what was going on with your Binder class, but getting the formProvider from the context injected providers was the key.
On Nov 2, 2011, at 2:37 PM, George Sapountzis wrote:
> On Wed, Nov 2, 2011 at 8:45 PM, Jason Erickson <jason_at_jasonerickson.com> wrote:
>> What I would like to do is something like this:
>>
>> @POST
>> @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
>> public void submitPerson(Person person) {
>> personDao.save(person);
>> }
>>
>>
>> There might be more to it, but that's the gist. I tried to write a MessageBodyReader<Person> that consumes application/x-www-form-urlencoded, but the readFrom method simply takes an InputStream. I was going to transform that into a MultivaluedMap<String, String> but that's turning out not to be very straightforward for me (I can't instantiate my own). Is there something I'm missing? Do I just have to get down to the nuts and bolts of reading the InputStream and constructing my own map?
>>
>>
>
> see https://github.com/gsapountzis/jersey-binding/blob/master/src/main/java/com/github/gsapountzis/jersey/binding/impl/provider/FormBeanProvider.java
> for how to get the Form / MultivaluedMap<String, String> from the
> InputStream.