spring时间(date)无法转入后台

springmvc时间(date)无法转入后台(@DateTimeFormat+@JsonFormat(GMT+8))

Type Status Report

Description 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).

解决方案:

方案一:

 如果用实体类接收参数,则在Date属性上边加@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")

springmvc时间(date)无法转入后台(@DateTimeFormat+@JsonFormat(GMT+8))

 方案二:

接收参数前边加一个@DateTimeFormat(pattern = "yyyy-MM-dd")

springmvc时间(date)无法转入后台(@DateTimeFormat+@JsonFormat(GMT+8))

 当是json时候,使用@JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")

springmvc时间(date)无法转入后台(@DateTimeFormat+@JsonFormat(GMT+8))

 


 
                    
            
                

相关文章:

  • 2021-07-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-14
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-24
  • 2021-06-12
  • 2021-10-03
  • 2021-04-24
  • 2021-08-14
相关资源
相似解决方案