users@jersey.java.net

[Jersey] Re: how to rename XmlRootElement in JSON

From: Maxrunner <joao.rossa_at_gmail.com>
Date: Sun, 5 Jun 2011 15:33:29 -0700 (PDT)

Hi! been on vacations so sorry for not answering sooner. But im currently
using fixed 1.8 version that allows to use one or other mapper according to
type. Can you verify this?

regards,

On Wed, Jun 1, 2011 at 8:04 AM, Jakub Podlesak-2 [via Jersey] <
ml-node+6425845-44216407-73314_at_n2.nabble.com> wrote:

> Hi,
>
> i just saw the super() and MyObjectMapperProvider() (this won't compile
> anyway, right;-)
> calls and wanted to make sure you understand, you can not have more than
> one ContextResolver<ObjectMapper> classes defined in your application,
> as more than one such resolvers would introduce an ambiguity.
>
> ~Jakub
>
> On 05/31/2011 11:47 AM, Maxrunner wrote:
>
> > Thanks jakub, its working fine now :). Still i didnt understand the
> second
> > correction you made to my contextresolver:
> >
> > "@Provider
> > public class JacksonObjectMapperProvider implements
> > ContextResolver<ObjectMapper>{
> >
> > private ObjectMapper defaultObjectMapper;
> > private ObjectMapper listsObjectMapper;
> >
> >
> > public JacksonObjectMapperProvider() {
> > super();
> > MyObjectMapperProvider();
> > }
> >
> > I do not know what the above means. Please note, that you should register
>
> > just one ContextResolver<ObjectMapper> instance, as Jackson will use
> only
> > the first one
> > if more that one such provider is found. To create different object
> mappers,
> > you should
> > use the getContext method bellow."
> >
> > Didnt understand this correction, can you elaborate?
> >
> > --
> > View this message in context:
> http://jersey.576304.n2.nabble.com/how-to-rename-XmlRootElement-in-JSON-tp6173292p6422046.html
>
> > Sent from the Jersey mailing list archive at Nabble.com.
> >
>
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://jersey.576304.n2.nabble.com/how-to-rename-XmlRootElement-in-JSON-tp6173292p6425845.html
> To unsubscribe from how to rename XmlRootElement in JSON, click here<http://jersey.576304.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=6173292&code=am9hby5yb3NzYUBnbWFpbC5jb218NjE3MzI5MnwyMDYzODA1MDkw>.
>
>


--
View this message in context: http://jersey.576304.n2.nabble.com/how-to-rename-XmlRootElement-in-JSON-tp6173292p6443338.html
Sent from the Jersey mailing list archive at Nabble.com.