JacksonProviderProxy writing out null values in json output

Viewed 6462

I have a simple POJO class that extends another simple POJO class. I am using the com.sun.jersey.json.impl.provider.entity.JacksonProviderProxy to marshall the properties in these POJO classes to JSON. However, when I set some of the properties to the POJO as null, then it outputs those properties as the string null instead of not outputting it at all.

for eg.

{
   Person:
   [{
      "firstName":"John"
      "lastName":"null"
    }]
}

instead of:

for eg.

{
   Person:
   [{
      "firstName":"John"
    }]
}
1 Answers
Related