Search in sources :

Example 1 with TodoPriorityPropertyEditor

use of com.in28minutes.springmvc.web.util.TodoPriorityPropertyEditor in project SpringStepByStep by JavaProgrammerLB.

the class TodoController method initBinder.

@InitBinder
public void initBinder(WebDataBinder binder) {
    SimpleDateFormat dateFormat = new SimpleDateFormat(TodoListUtils.DATE_FORMAT);
    binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false));
    binder.registerCustomEditor(Priority.class, new TodoPriorityPropertyEditor());
}
Also used : CustomDateEditor(org.springframework.beans.propertyeditors.CustomDateEditor) SimpleDateFormat(java.text.SimpleDateFormat) TodoPriorityPropertyEditor(com.in28minutes.springmvc.web.util.TodoPriorityPropertyEditor) InitBinder(org.springframework.web.bind.annotation.InitBinder)

Aggregations

TodoPriorityPropertyEditor (com.in28minutes.springmvc.web.util.TodoPriorityPropertyEditor)1 SimpleDateFormat (java.text.SimpleDateFormat)1 CustomDateEditor (org.springframework.beans.propertyeditors.CustomDateEditor)1 InitBinder (org.springframework.web.bind.annotation.InitBinder)1