LawrenceSin 2017-11-14 07:46 采纳率: 0%
浏览 4679
已结题

springMVC注解的时间注解不起作用

如题 配置@DateTimeFormat和 也有了joda-time

但注解@DateTimeFormat就是不起作用,一直报404
把这个注解去了 就没事,但时间格式就有问题了
The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). 上面是报的错误

  • 写回答

2条回答

  • like_a_cat 2017-11-14 08:26
    关注

    使用注解.在需要转换的参数或实体类属性上添加@DateTimeFormatter(pattern=”表达式”)
    2.1 使用Date参数接收
    @RequestMapping("demo")
    public String demo(@DateTimeFormat(pattern="yyyy-MM-dd") Date time){
    System.out.println(time);
    return "abc.jsp";
    }

    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog