cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "adam.galloway" <>
Subject Another question about nillable=true and minOccurs=0
Date Wed, 18 Feb 2009 15:05:58 GMT

I have a JAX-RS service that Consumes json which maps to a POJO with JAXB. 
I'm having a hard time finding out how to tell wether a particular field has
been sent in with a null value or whether the value of the field was left
out of the incoming json.

The basic idea is that I have a pojo defined like this:

@XmlRootElement(name = "myPojo")
public class MyPojo {
   private Long id;
   private String name;
   private Date date;

   // getters and setters...

My service:

public class MyService {

   public Response myMethod(MyPojo pojo) {
        //process pojo here

What I'd like to be able to tell from MyService.myMethod() is whether
pojo.getDate() is null because the json had date nulled out or the json did
not include the date field.

Any suggestions would be greatly appreciated.
View this message in context:
Sent from the cxf-user mailing list archive at

View raw message