Hi
On 25/08/14 11:00, Vassilis Virvilis wrote:
Hi,

ok that makes sense for MessageBodyReader. However I can't remove
@FormParam because I have multiple parameter to pass. But if I run out
of all other options I may manually parse the document and all the
parameters. So this is a viable solution. I think...

MultivaluedMap is a spec compliant way to capture multiple form parameters.
Can you also comment on the List<List<Entity>> issue? What is the
expected payload in the form parameters for CXF to parse correctly or at
least delegate parsing to ParamConverter?

I see that the runtime does not pass a generic type of the given parameter to ParamConverterProvider, I'll fix it, so you'd have
List<List<Entity>> working with the ParamConverterProvider too.
Thanks, Sergey
Thanks

    Vassilis


On 08/25/2014 12:34 PM, Sergey Beryozkin wrote:
Hi Vassilis
For MessageBodyReader to work you need to remove a @FormParam
annotation, give it a try please
Cheers, Sergey


On 25/08/14 09:33, Vassilis Virvilis wrote:
Hi Sergey, everybody

I managed to do some work on Resty-GWT

https://github.com/resty-gwt/resty-gwt/issues/195
https://github.com/resty-gwt/resty-gwt/pull/196

With the patches (not yet applied) I can transmit and receive plain
List<Entity> with no wrapper object.

Now I am hitting another roadblock and any input, especially from you
Sergey is highly appreciated. I am trying to transmit a list of lists
List<List<Entity>>. With my patches applied RestyGWT sends something
like this in @FormParam

public void test(@FormParam("lists-of-entities") List<List<Entity>>);

the play load is
lists-of-entities:[...json representation of List<Entity> as json
array ]
lists-of-entities:[...json representation of List<Entity> as json
array ]

Now I am expecting my ParamConverter to be called with List<Entity> type
but it is called with plain Entity and it fails because it tries to
deserialize an array. Now why it is doing that? From my interpretation
of the standard is that it should break the outer list to multiple
parameters with the same name. How it can expect to do the same with the
inner list? There is not enough information to assemble it back.

I tried to register also a MessageBodyReader but that also failed. Its
functions are not called at all, while at the same time
MessageBodyWriter is getting called and it works all right. Note that I
have one class implementing ParamConverterProvider, MessageBodyWriter,
MessageBodyReader. Any ideas why it is not working?

    Vassilis




Reply via email to