我是新來的Spring MVC - 我想從我的javascript傳遞一個日期作爲申請帕拉姆傳遞日期要求PARAM在Spring MVC
我的控制器看起來像 -
public @ResponseBody List<RecordDisplay> getRecords(
@RequestParam(value="userID") Long userID,
@RequestParam(value="fromDate") Date fromDate,
@RequestParam(value="toDate") Date toDate) {
我的問題是我怎麼做的從JavaScript調用 - 在又該URL看起來像
for eg. - /getRecords?userID=1&fromDate=06022013&toDate=08022013'
我需要一種方法來解析日期所以Spring可以識別它?
你能分享你用來比較兩個日期的代碼嗎? – rachana