Hello everyone,
I had a quick question on output formatting. Out of the box jersey supports XML and Jason, which is great for my application. However when I was using it, I noticed that output ignores fields with null values. So if you have an object
@XMLRootElement
Class Foo {
Integer num;
Date date;
....
}
When this has been marshalled into the XML file if the date field is null, my output does not have that element in it. What I want to do is include all the fields in the output; and if they are null, replace them with - say a blank. So for "application/xml" the output should be :
<foo>
<num>123</num>
<date></date>
</foo>
I think Jersey uses JAXB internally to do the marshalling, and I wasn't able to find anything in the JAXB documentation on how to do that, so I'm a bit concerned if something like this is even possible.
Thanks,
Jalpesh.
________________________________
PRIVILEGED AND CONFIDENTIAL
This transmission may contain privileged, proprietary or confidential information. If you are not the intended recipient, you are instructed not to review this transmission. If you are not the intended recipient, please notify the sender that you received this message and delete this transmission from your system.