My web application uses struts2-json-plugin-2.2.1
I have an action that provides an object loaded from the database (via sleep mode).
This object contains the java.util.Date field, which is annotated like this:
@JSON(format = "dd-MM-yyyy") @Column(name = "DATA_CREAZIONE", nullable = false) public Date getDataCreazione() { return this.dataCreazione; }
Instead of getting:
"dataCreazione":"15-02-2013"
I get this:
"dataCreazione":"2013-02-15T16:51:06"
In debugging, I notice that the org.apache.struts2.json.JSONWriter class does not find any annotation using the getDataCreazione method and that the proxy class is of type "$$_javassist" and not "$$EnhancerByCGLIB$$" like other cases. ..
In the same application, I have many such situations, and the annotation works fine. I don't understand what the problem (or difference) is with other classes.
Do you have any suggestions?
source share