Search in sources :

Example 11 with CustomDateEditor

use of org.springframework.beans.propertyeditors.CustomDateEditor in project Asqatasun by Asqatasun.

the class AbstractUserAndContractsController method initBinder.

@InitBinder
protected void initBinder(WebDataBinder binder) {
    SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
    binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false));
}
Also used : CustomDateEditor(org.springframework.beans.propertyeditors.CustomDateEditor) SimpleDateFormat(java.text.SimpleDateFormat) InitBinder(org.springframework.web.bind.annotation.InitBinder)

Example 12 with CustomDateEditor

use of org.springframework.beans.propertyeditors.CustomDateEditor 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

CustomDateEditor (org.springframework.beans.propertyeditors.CustomDateEditor)12 SimpleDateFormat (java.text.SimpleDateFormat)10 DateFormat (java.text.DateFormat)7 Test (org.junit.Test)7 TestBean (org.springframework.tests.sample.beans.TestBean)7 ServletRequestDataBinder (org.springframework.web.bind.ServletRequestDataBinder)7 PageContext (javax.servlet.jsp.PageContext)6 IndexedTestBean (org.springframework.tests.sample.beans.IndexedTestBean)6 NestedTestBean (org.springframework.tests.sample.beans.NestedTestBean)6 InitBinder (org.springframework.web.bind.annotation.InitBinder)3 Date (java.util.Date)2 PropertyEditorRegistrar (org.springframework.beans.PropertyEditorRegistrar)2 PropertyEditorRegistry (org.springframework.beans.PropertyEditorRegistry)2 DefaultListableBeanFactory (org.springframework.beans.factory.support.DefaultListableBeanFactory)2 TodoPriorityPropertyEditor (com.in28minutes.springmvc.web.util.TodoPriorityPropertyEditor)1 StringWriter (java.io.StringWriter)1 ArrayList (java.util.ArrayList)1 JspException (javax.servlet.jsp.JspException)1 StudyBean (org.akaza.openclinica.bean.managestudy.StudyBean)1 SdvFilterDataBean (org.akaza.openclinica.controller.helper.SdvFilterDataBean)1