Request method 'GET' not supported

来源:互联网 发布:小土豆编程破解版 编辑:程序博客网 时间:2024/05/22 15:19

Tomcat 报错信息如下:

HTTP Status 405 - Request method 'GET' not supportedtype Status reportmessage Request method 'GET' not supporteddescription The specified HTTP method is not allowed for the requested resource (Request method 'GET' not supported).Apache Tomcat/6.0.33

在网上搜了一下大家都说是servlet的doget 或dopost方法没有重写

我的根本就不是这情况我是用Json往控制器传输数据的时候报的错 原因是json对日期的封装没有弄好

就是json传时间的原因 如果之有年月日 那很简单 如果有时分秒就要小心了在bean里的get和set方法上加注解如下

@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone="GMT+08:00")

在bean类前面加

@JsonIdentityInfo(generator=ObjectIdGenerators.IntSequenceGenerator.class, property="jsonid")这样就能解决十分秒的问题了

原文详细信息见我百度空间

http://hi.baidu.com/294286540/item/b509bb0e04a2a77bbfe97e80