As for the title. I don't want to add an annotation(@Json(format="yyyy-MM-dd HH:mm:ss") on every getXXXDate(),can anybody give a solution?
Asked
Active
Viewed 2,113 times
1 Answers
6
You can use struts 2 json plugins in object class, for example:
private Date createdDate;
@JSON(format="MM/dd/yyyy")
// or @JSON(format="date.format") from bundle resource properties files
public Date getCreatedDate() {
return createdDate;
}
public void setCreatedDate(Date createdDate) {
this.createdDate = createdDate;
}

SonTL
- 361
- 4
- 6
-
best solution for my requirement which cant able to get in jsonplugin page. thanks @sonTL – arvindwill Jul 05 '12 at 05:01