@InitBinder("systemNotificationForm") protected void initBinder(WebDataBinder binder) { binder.setValidator(systemNotificationValidator); SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy HH:mm"); sdf.setTimeZone(TimeZone.getTimeZone("GMT")); binder.registerCustomEditor(Date.class, new CustomDateEditor(sdf, true)); binder.registerCustomEditor( SystemNotificationType.class, new EnumEditor(SystemNotificationType.class)); binder.registerCustomEditor( SystemNotificationSeverity.class, new EnumEditor(SystemNotificationSeverity.class)); binder.registerCustomEditor( List.class, "types", new CustomCollectionEditor(List.class) { @Override protected Object convertElement(Object element) { SystemNotificationType type = null; if (element != null) { try { type = SystemNotificationType.valueOf((String) element); } catch (Exception ex) { log.error( String.format( "Error converting element to SystemNotificationType: %s", element), ex); } } return type; } }); }
@Override protected void initBinderInternal(WebDataBinder binder) { if (binder.getTarget() instanceof Service36400234Form) { super.setValidator(validator); binder.setValidator(validator); } }
@InitBinder protected void initBinder(WebDataBinder binder) { LazyBindingErrorProcessor errorProcessor = new LazyBindingErrorProcessor(); binder.setValidator( new SavingsProductFormValidator(errorProcessor, configurationServiceFacade)); binder.setBindingErrorProcessor(errorProcessor); }
public WebDataBinder createBinder(NativeWebRequest webRequest, Object target, String objectName) throws Exception { LocalValidatorFactoryBean validator = new LocalValidatorFactoryBean(); validator.afterPropertiesSet(); WebDataBinder dataBinder = new WebDataBinder(target, objectName); dataBinder.setValidator(validator); return dataBinder; }
@InitBinder protected void initBinder(WebDataBinder binder) { if (binder.getTarget() instanceof User) { binder.setValidator(registerValidator); SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy"); binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true)); } }
@InitBinder public void initBinder(WebDataBinder binder) { binder.setValidator(formValidator); binder.registerCustomEditor(Date.class, "dateAdded", datePropertyEditor); binder.registerCustomEditor(Date.class, "dateLastModified", datePropertyEditor); binder.registerCustomEditor(State.class, "state", statePropertyEditor); binder.registerCustomEditor(Country.class, "country", countryPropertyEditor); binder.registerCustomEditor(City.class, "city", cityPropertyEditor); }
/** * For some security. Defines which fields can be bound (whitelist), and which ones cannot. * * <p>Also adds validation that spans more than one field * * @param binder */ @InitBinder public void initialiseBinder(WebDataBinder binder) { binder.setDisallowedFields("unitsOnOrder", "discontinued"); binder.setAllowedFields( "productId", "name", "unitPrice", "description", "manufacturer", "category", "unitsInStock", "condition", "productImage", "productManual", "language"); // binder.addValidators(productValidator); binder.setValidator(productValidator); }
@InitBinder protected void initBinder(WebDataBinder binder) { binder.setValidator(loginValidator); }
@InitBinder protected void initBinder(WebDataBinder binder) { binder.setValidator(employeeFormValidator); binder.registerCustomEditor(Float.class, new CustomNumberEditor(Float.class, false)); }
@InitBinder("person") public void initBinder(WebDataBinder binder) { binder.setConversionService(conversionService); binder.setValidator(validator); }
/** @param binder */ @InitBinder(COMMAND_ATTR_NAME) protected void initBinder(final WebDataBinder binder) { binder.setValidator(new CreateAppointmentFormBackingObjectValidator()); }
@InitBinder protected void initBinder(WebDataBinder binder) { binder.setValidator(new RetailCustomerValidator()); }
@InitBinder("fileBucket") protected void initBinder(WebDataBinder binder) { binder.setValidator(fileValidator); }
@InitBinder("form") public void requestValidator(WebDataBinder binder) { binder.setValidator(new EditRegisterRequestValidator()); binder.setBindingErrorProcessor(new ExceptionBindingErrorProcessor()); }
@InitBinder(value = {"tipMessage"}) protected void initBinder(WebDataBinder binder) { binder.setValidator(tipMessageValidator); }
@InitBinder public void initBinder(WebDataBinder binder) { // https://jira.springsource.org/browse/SPR-6437 binder.setValidator(new DelegatingValidatorAdaptor(binder.getValidator())); }
@InitBinder protected void initBinder(WebDataBinder binder) { binder.setValidator(validator); binder.registerCustomEditor( Date.class, new CustomDateEditor(new SimpleDateFormat("kk:mm"), nullableDates)); }
@InitBinder public void initBinder(WebDataBinder binder) { binder.setValidator(new RegistrationFormValidator()); binder.setMessageCodesResolver(new SimpleMessageCodesResolver()); }
@InitBinder protected void initBinder(WebDataBinder binder, HttpSession session) { binder.setValidator( new PenaltyFormValidator( viewOrganizationSettingsServiceFacade.getOrganizationSettings(session))); }
@InitBinder protected void initBinder(WebDataBinder binder) { binder.setValidator(new CoaFormValidator()); }
/** * Регистрация валидатора для различных команд * * @param binder - webDaStaBinder */ @InitBinder private void initBinder(WebDataBinder binder) { binder.setValidator(validator); }
@InitBinder protected void initBinder(WebDataBinder binder) { binder.setValidator(new MemberRegisterForm()); }
@InitBinder("userFormBean") protected void initUserFormBeanBinder(WebDataBinder binder) { binder.setValidator(userFormBeanValidator); }
@InitBinder public void initValidator(final WebDataBinder binder) { if (binder.getTarget() != null && validator.supports(binder.getTarget().getClass())) { binder.setValidator(validator); } }
@InitBinder("contestResourcesBean") public void initBinder(WebDataBinder binder) { binder.setValidator(validator); }
/** @param binder */ @InitBinder("command") protected void initBinder(WebDataBinder binder) { binder.setValidator(new RemoveAccountFormBackingObjectValidator()); }
@InitBinder public void initBinder(WebDataBinder binder) { binder.setDisallowedFields("id"); binder.setValidator(new MyClass112Validator()); }
@InitBinder public void initBinder(WebDataBinder binder, HttpServletRequest req) { binder.setValidator(vf.getValidator()); // 安全测试 }