@ControllerAdvice public class DefaultAttributeController { // apply default value @ModelAttribute("newuser") public User getDefaultUser() { return new User(); } }
After Validation, ModelAttribite will no longer be available. We can use @ControllerAdivce which apply to all the controller to re-set the default values