I know that a DateTimeFormat annotation can be defined on Date properties of a Model class in Spring but is there any way of defining a default dateTimeFormat annotation for
As kuhajeyan mentioned, you can use binder, but not on a controller, rather on controller advice, that will apply it globally:
@ControllerAdvice
public class GlobalDateBinder {
/* Initialize a global InitBinder for dates*/
@InitBinder
public void binder(WebDataBinder binder) {
// here you can use kuhajeyan's code
}
}