Spring Framework DefaultBindingErrorProcessor - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework DefaultBindingErrorProcessor class.

This code example shows how to use the following methods:
This code example shows how to use the following methods:
/** 
 *  
 * @author Rostislav Hristov 
 * 
 */ 
public class ExtendedBindingErrorProcessor extends DefaultBindingErrorProcessor {
 
	public void processPropertyAccessException(PropertyAccessException ex, BindingResult bindingResult) {
		super.processPropertyAccessException(ex, bindingResult);
		Object[] arguments = bindingResult.getAllErrors().get(bindingResult.getErrorCount() - 1).getArguments();
		arguments[1] = ExceptionUtils.getRootCause(ex).getMessage();
	} 
 
	protected Object[] getArgumentsForBindError(String objectName, String field) {
		String[] codes = new String[] {objectName + Errors.NESTED_PATH_SEPARATOR + field, field};
		return new Object[] {new DefaultMessageSourceResolvable(codes, field), null};
	} 
	 
} 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
    private JseLocalValidatorFactoryBean factoryBean;
 
    /** 
     * デフォルトコンストラクタです。 
     */ 
    public JseBindingErrorProcessor() {} 
 
    /** 
     * {@link JseLocalValidatorFactoryBean}インスタンスを設定します。 
     * @param factoryBean {@link JseLocalValidatorFactoryBean}インスタンス 
     */ 
    public final void setJseLocalValidatorFactoryBean(JseLocalValidatorFactoryBean factoryBean) {
        this.factoryBean = factoryBean;
    } 
 
    /** 
     * {@inheritDoc} 
     */ 
    @Override 
    public void processPropertyAccessException(PropertyAccessException e, BindingResult bindingResult) {
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
import org.springframework.validation.BindingResult;
import org.springframework.validation.DefaultBindingErrorProcessor;
import ru.org.linux.site.ScriptErrorException; 
import ru.org.linux.user.UserNotFoundException; 
 
public class ExceptionBindingErrorProcessor extends DefaultBindingErrorProcessor {
  @Override 
  public void processPropertyAccessException(PropertyAccessException e, BindingResult bindingResult) {
    if (e.getCause() instanceof IllegalArgumentException &&
            (e.getCause().getCause() instanceof ScriptErrorException || e.getCause().getCause() instanceof UserNotFoundException)) {
      bindingResult.rejectValue(
              e.getPropertyChangeEvent().getPropertyName(),
              null, 
              e.getCause().getCause().getMessage()
      ); 
    } else { 
      super.processPropertyAccessException(e, bindingResult);
    } 
  } 
} 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
See Code Examples for Spring Framework DefaultBindingErrorProcessor Methods: