Passing date to request param in Spring MVC

前端 未结 3 1861
醉话见心
醉话见心 2020-12-08 13:10

I am new to Spring MVC - and I am trying to pass a date from my javascript as a request Param

My controller looks something like -

public @ResponseB         


        
3条回答
  •  时光取名叫无心
    2020-12-08 13:48

    Use @DateTimeFormat(pattern="yyyy-MM-dd") where yyyy is year, MM is month and dd is date

    public @ResponseBody List loadStudents(@DateTimeFormat(pattern="yyyy-MM-dd") Date birthDay) {
        ...
    }
    

提交回复
热议问题