I have objects with fields setup like this:

 @XmlElement(nillable = true)
 protected Integer id;

that I send out via JAX-RS with @Produces(MediaType.APPLICATION_JSON). The json 
payload ends up like this when the fields aren't set:


 "id":{"@xsi.nil":"true"}

I can't change the @XmlElement on the field because another part of my system 
depends on it. I want to either output:

 "id" : null

or ideally not output that field at all in the json payload. I think I need 
extend the built in JSONProvder and tweak it (and/or Jettison) a little bit. 


How can I do that without Spring? Can someone explain a solution both in terms 
of web.xml and JAXRSServerFactoryBean (unit testing)?

Thanks,
Ron

Reply via email to