users@jersey.java.net

Re: [Jersey] JSONJAXBContext

From: Felipe Gaúcho <fgaucho_at_gmail.com>
Date: Wed, 16 Dec 2009 20:44:25 +0100

in the pom.xml

                <dependency>
                        <groupId>com.sun.xml.bind</groupId>
                        <artifactId>jaxb-impl</artifactId>
                        <version>2.1.10</version>
                </dependency>

---------- JSONJAXBContext doesn't exists in the classpath

the JSON provider:

@Provider
public class MyJAXBContextResolver implements ContextResolver<JAXBContext> {

        private JAXBContext context;
        private Class[] types = null;//{ StatusInfoBean.class, JobInfoBean.class };

        public MyJAXBContextResolver() throws Exception {
                this.context = new
JSONJAXBContext(JSONConfiguration.natural().build(), types);
        }

        public JAXBContext getContext(Class<?> objectType) {
                return (types[0].equals(objectType)) ? context : null;
        }
}


2009/12/16 Felipe Gaúcho <fgaucho_at_gmail.com>:
> humm.. I celebrated too early.. XML never had that symbol anyway.......
>
> so I am forced to ask again.. how to do that ?
>
> * I am using JAXB annotated classes, is it possible to remove the @
> symbol from @XmlAttribute fields ?
>



-- 
------------------------------------------
   Felipe Gaúcho
   10+ Java Programmer
   CEJUG Senior Advisor