Spring inject Date into bean property – CustomDateEditor
Spring example to show you how to inject a “Date” into bean property. In Spring, you can inject a Date via two methods. Factory bean: Declare a dateFormat bean, in “customer” bean, reference “dateFormat” bean as a factory bean. CustomDateEditor: The factory method will call SimpleDateFormat.parse() to convert String into Date object automatically.