【发布时间】:2017-04-26 15:29:14
【问题描述】:
我有一个弹簧控制器以 json 格式返回一个实体。该实体包含一个日期,我想根据实体中的一个字段返回 12 小时格式或 24 小时格式。 Spring或jackson是否提供这种功能?
@RequestMapping(value = "/{systemName}",method = RequestMethod.GET)
public Entity getEntityByName(@PathVariable String name,HttpServletResponse response){
Entity entity = service.getEntity(name);
if(entity ==null){
response.setStatus(404);
}
return entity ;
}
【问题讨论】:
-
代码示例与您的问题有何关联?
标签: java json spring-mvc date-format