-
1. Re: Programmatic access to Marshaller
csa Mar 7, 2014 5:35 PM (in response to jasper.oosterman)1 of 1 people found this helpfulHi Jasper,
On the client, that's possible using MarshallingWrapper.(to|from)JSON(). It will check if Jackson marshalling was enabled (http://docs.jboss.org/errai/3.0-SNAPSHOT/errai/reference/html_single/#sid-19398997_ErraiJAX-RS-Configuration) and is capable of producing and consuming Jackson. On the server, you can use ServerMarshalling(to|from)JSON(). However, on the server, we don't have a utility that consumes and produces Jackson since you can reuse any existing library there.
So, we don't exactly have what you want. If you have a suggestion for an addition or want to send a pull request please let us know.
Cheers,
Christian
-
2. Re: Re: Programmatic access to Marshaller
jasper.oosterman Apr 8, 2014 8:51 AM (in response to csa)Hi Christian,
Thanks for your answer and sorry for not replying sooner. I got something working with Gson that worked for me but I would still like to do it the correct way so I'll try to rephrase my question:
On the server I can choose to include the
errai-jaxrs-provider-${errai.version}.jar which caused the Jackson marshaller to be used and, when missing, uses the ERRAI marshaller instead. This means that somewhere in the ERRAI code the choice between the two marshallers is made and I am wondering how that is done.
Because either way there is a marshaller present that takes care of (de-)serialization so I should not be needing a third party lib such as Gson to do that for me. I hope I have made myself more clear.
Greetings, Jasper
-
3. Re: Programmatic access to Marshaller
csa Apr 8, 2014 2:14 PM (in response to jasper.oosterman)Hi Jasper,
The errai-jaxrs-provider registers Errai marshalling support (support for Errai's JSON format) with JAX-RS (RestEasy) on the server. If you have RestEasy configured to use Jackson, you don't need to deploy the errai-jaxrs-provider.
The only switch we have is for the client (see link above) to configure which format is expected on the client (Errai's JSON or Jackson).
Cheers,
Christian