至于标题.我不想在每个getXXXDate()上添加一个注释(@Json(format ="yyyy-MM-dd HH:mm:ss"),任何人都可以提供解决方案吗?
小智 6
您可以在对象类中使用struts 2 json插件,例如:
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;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1974 次 |
| 最近记录: |