Example usage for org.springframework.web.bind WebDataBinder setBindingErrorProcessor

List of usage examples for org.springframework.web.bind WebDataBinder setBindingErrorProcessor

Introduction

In this page you can find the example usage for org.springframework.web.bind WebDataBinder setBindingErrorProcessor.

Prototype

public void setBindingErrorProcessor(BindingErrorProcessor bindingErrorProcessor) 

Source Link

Document

Set the strategy to use for processing binding errors, that is, required field errors and PropertyAccessException s.

Usage

From source file:ru.org.linux.user.EditRegisterController.java

@InitBinder("form")
public void requestValidator(WebDataBinder binder) {
    binder.setValidator(new EditRegisterRequestValidator());
    binder.setBindingErrorProcessor(new ExceptionBindingErrorProcessor());
}

From source file:ru.org.linux.topic.AddTopicController.java

@InitBinder("form")
public void requestValidator(WebDataBinder binder) {
    binder.setValidator(addTopicRequestValidator);

    binder.setBindingErrorProcessor(new ExceptionBindingErrorProcessor());
}

From source file:ru.org.linux.comment.CommentService.java

public void requestValidator(WebDataBinder binder) {
    binder.setValidator(new CommentRequestValidator());
    binder.setBindingErrorProcessor(new ExceptionBindingErrorProcessor());
}

From source file:ru.org.linux.search.SearchController.java

@InitBinder
public void initBinder(WebDataBinder binder) {
    binder.registerCustomEditor(SearchOrder.class, new PropertyEditorSupport() {
        @Override/*from   www  .jav  a2s  .com*/
        public void setAsText(String s) throws IllegalArgumentException {
            if ("1".equals(s)) { // for old links
                setValue(SearchOrder.RELEVANCE);
            } else if ("2".equals(s)) {
                setValue(SearchOrder.DATE);
            } else {
                setValue(SearchOrder.valueOf(s));
            }
        }
    });

    binder.registerCustomEditor(SearchInterval.class, new PropertyEditorSupport() {
        @Override
        public void setAsText(String s) throws IllegalArgumentException {
            setValue(SearchInterval.valueOf(s.toUpperCase()));
        }
    });

    binder.registerCustomEditor(SearchRange.class, new PropertyEditorSupport() {
        @Override
        public void setAsText(String s) throws IllegalArgumentException {
            setValue(SearchRange.valueOf(s.toUpperCase()));
        }
    });

    binder.registerCustomEditor(User.class, new UserPropertyEditor(userDao));

    binder.setBindingErrorProcessor(new ExceptionBindingErrorProcessor());
}

From source file:org.mifos.ui.core.controller.DefineSavingsProductsFormController.java

@InitBinder
protected void initBinder(WebDataBinder binder) {
    LazyBindingErrorProcessor errorProcessor = new LazyBindingErrorProcessor();
    binder.setValidator(new SavingsProductFormValidator(errorProcessor, configurationServiceFacade));
    binder.setBindingErrorProcessor(errorProcessor);
}

From source file:ru.org.linux.topic.EditTopicController.java

@InitBinder("form")
public void requestValidator(WebDataBinder binder) {
    binder.setValidator(new EditTopicRequestValidator());

    binder.setBindingErrorProcessor(new ExceptionBindingErrorProcessor());
}

From source file:ru.org.linux.user.RegisterController.java

@InitBinder("form")
public void requestValidator(WebDataBinder binder) {
    binder.setValidator(new RegisterRequestValidator());

    binder.setBindingErrorProcessor(new ExceptionBindingErrorProcessor());
}