@RequestMapping(value = "/time/now",method = RequestMethod.GET)
public SeckillResult<Long> time(){
Date now= new Date();
return new SeckillResult<Long>(true,now.getTime());
}
方法没加@ResponseBody
报错 HTTP Status 404 - /WEB-INF/jsp/seckill/time/now.jsp
应改为:
@RequestMapping(value = "/time/now",method = RequestMethod.GET)
@ResponseBody
public SeckillResult<Long> time(){
Date now= new Date();
return new SeckillResult<Long>(true,now.getTime());
}