後にhttp 400の問題(構文が悪い)が発生します
<input type="hidden" id="_orderDate_id" name="orderDate" value="${orderDate}"/>
しかし、この入力要素を削除した後はすべて問題ありません
しかし、本当にそのような日付フィールドをフォーマットする必要があるのでしょうか?
コントローラーで使用される日付形式のバインダーを次に示します。
@InitBinder
public void registerDateBinder(WebDataBinder binder) {
DateFormat printFormat = new SimpleDateFormat(DateTimeFormat.patternForStyle("S-", LocaleContextHolder.getLocale())); // format for data on the UI
printFormat.setLenient(false);
DateFormat sortFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy"); // format for data get back from UI
sortFormat.setLenient(false);
binder.registerCustomEditor(Date.class, new ExpandableCustomDateEditor(printFormat, Arrays.asList(printFormat, sortFormat), true));
}