Noah said: "I suppose I could break this into two resources, one
consuming JSON and one consuming FormData but I'd rather not - seems
like it defeats the purpose."
So, I was assuming he knows about breaking it up into two methods and
was wondering how to avoid it.
Martin
On 18.3.2011 18:39, Tatu Saloranta wrote:
> On Fri, Mar 18, 2011 at 3:03 AM, Martin Matula<martin.matula_at_oracle.com> wrote:
>> Jersey does not know how to deserialize your bean from a plain text request
>> - you have to implement that logic yourself by writing your own
>> MessageBodyReader that takes a stream of plain text and constructs FooBean
>> from it. Then it will work as you expect.
> This is correct if considering method as presented, but I think in
> original idea was he want to offer two endpoints, but for some reason
> tried rolling them into a single method (i.e. idea is to either take a
> String, or a structured data to bind as POJO).
> I think Jakub's example would solve this.
>
> -+ Tatu +-