zoukankan      html  css  js  c++  java
  • "The request sent by the client was syntactically incorrect ()"问题定位及解决:

    Spring MVC "The request sent by the client was syntactically incorrect ()"解决办法:

    把spring日志级别调整到debug级别,可以看到更多的前端请求后台的日志,可以更精确的定位到底哪里出错了。

    log4j.properties添加一行:

    log4j.logger.org.springframework=DEBUG  

    看到console控制台日志:日期转换异常。一般是你前端的页面的日期传到后台,格式转换异常。需要你重新设置下日期格式,前后端要对应。

    解决方法:Controller层加入转换方法

       /*
         * 解决createTime格式转换问题Date to String
         */
        @InitBinder  
        public void initBinder(WebDataBinder binder) {  
            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");  
            dateFormat.setLenient(false);  
            binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false));
        }

    参考文献:http://blog.csdn.net/yiluoak_47/article/details/10821747

  • 相关阅读:
    多线程-共享全局变量问题
    多线程-共享全局变量
    线程-注意点
    线程
    最短网络Agri-Net
    2455 繁忙的都市
    2597 团伙
    5929 亲戚
    5969 [AK]刻录光盘
    JavaEE Tutorials (6)
  • 原文地址:https://www.cnblogs.com/cangdingju/p/5519088.html
Copyright © 2011-2022 走看看