在PRINT_LOGIN中,请求URI绑定到bindingResult对象的错误,我需要将其传递给另一个请求URI(VERIFY_ACCOUNT),我可以检查错误并执行我的操作
@RequestMapping(PRINT_LOGIN)
public String printLogin(Map<String, Object> model, @Valid PrintLoginForm printLoginForm,
BindingResult bindingResult, HttpServletRequest request) throws IOException {
String accountNum = printLoginForm.getAccountNumber();
String zipCode = printLoginForm.getZipCode();
if (StringUtils.isNotBlank(accountNum) && StringUtils.isNotBlank(zipCode)) {
// valid
} else { // Invalid
bindingResult.reject("ERROR_INVALID_ACCOUNTNUMBER");
// How to pass this bindingResult to the below URI ?
return createRedirectUri(VERIFY_ACCOUNT);
}
return VIEW_ACCOUNT_INDENTIFICATION;
}
@RequestMapping(VERIFY_ACCOUNT)
public String verifyAccount(Map<String, Object> model, HttpServletRequest request) {
//How to get bindingResult object from the above request ?
return VIEW_VERIFY_ACCOUNT;
}