Examples of rejectValue()


Examples of org.springframework.validation.BindException.rejectValue()

    PageContext pc = createPageContext();
    TestBean tb = new TestBean();
    tb.setName("name1");
    Errors errors = new BindException(tb, "tb");
    errors.rejectValue("name", "code1", null, "message & 1");
    errors.rejectValue("name", "code2", null, "message2");
    pc.getRequest().setAttribute(BindingResult.MODEL_KEY_PREFIX + "tb", errors);

    // test global property (should be null)
    BindTag tag = new BindTag();
    tag.setPageContext(pc);
View Full Code Here

Examples of org.springframework.validation.BindingResult.rejectValue()

    this.mvcResult = getMvcResult(mav);

    Date date = new Date();
    BindingResult bindingResultWithError = new BeanPropertyBindingResult(date, "date");
    bindingResultWithError.rejectValue("time", "error");

    ModelAndView mavWithError = new ModelAndView("view", "good", "good");
    mavWithError.addObject("date", date);
    mavWithError.addObject(BindingResult.MODEL_KEY_PREFIX + "date", bindingResultWithError);
View Full Code Here

Examples of org.springframework.validation.Errors.rejectValue()

    // construct an errors instance of the tag
    TestBean target = new TestBean();
    target.setName("Rob Harrop");
    Errors errors = new BeanPropertyBindingResult(target, COMMAND_NAME);
    errors.rejectValue("name", "some.code", "Default Message");

    exposeBindingResult(errors);

    int result = this.tag.doStartTag();
    assertEquals(BodyTag.EVAL_BODY_BUFFERED, result);
View Full Code Here

Examples of org.springframework.validation.Errors.rejectValue()

    // construct an errors instance of the tag
    TestBean target = new TestBean();
    target.setName("Rob Harrop");
    Errors errors = new BeanPropertyBindingResult(target, COMMAND_NAME);
    errors.rejectValue("name", "some.code", "Default Message");

    exposeBindingResult(errors);

    int result = this.tag.doStartTag();
    assertEquals(BodyTag.EVAL_BODY_BUFFERED, result);
View Full Code Here

Examples of org.springframework.validation.Errors.rejectValue()

    // construct an errors instance of the tag
    TestBean target = new TestBean();
    target.setName("Rob Harrop");
    Errors errors = new BeanPropertyBindingResult(target, COMMAND_NAME);
    errors.rejectValue("name", "some.code", "Default Message");

    exposeBindingResult(errors);

    int result = this.tag.doStartTag();
    assertEquals(BodyTag.EVAL_BODY_BUFFERED, result);
View Full Code Here

Examples of org.springframework.validation.Errors.rejectValue()

  public void testWithErrors() throws Exception {
    // construct an errors instance of the tag
    TestBean target = new TestBean();
    target.setName("Rob Harrop");
    Errors errors = new BeanPropertyBindingResult(target, COMMAND_NAME);
    errors.rejectValue("name", "some.code", "Default Message");
    errors.rejectValue("name", "too.short", "Too Short");

    exposeBindingResult(errors);

    int result = this.tag.doStartTag();
View Full Code Here

Examples of org.springframework.validation.Errors.rejectValue()

    // construct an errors instance of the tag
    TestBean target = new TestBean();
    target.setName("Rob Harrop");
    Errors errors = new BeanPropertyBindingResult(target, COMMAND_NAME);
    errors.rejectValue("name", "some.code", "Default Message");
    errors.rejectValue("name", "too.short", "Too Short");

    exposeBindingResult(errors);

    int result = this.tag.doStartTag();
    assertEquals(BodyTag.EVAL_BODY_BUFFERED, result);
View Full Code Here

Examples of org.springframework.validation.Errors.rejectValue()

  public void testWithEscapedErrors() throws Exception {
    // construct an errors instance of the tag
    TestBean target = new TestBean();
    target.setName("Rob Harrop");
    Errors errors = new BeanPropertyBindingResult(target, COMMAND_NAME);
    errors.rejectValue("name", "some.code", "Default <> Message");
    errors.rejectValue("name", "too.short", "Too & Short");

    exposeBindingResult(errors);

    int result = this.tag.doStartTag();
View Full Code Here

Examples of org.springframework.validation.Errors.rejectValue()

    // construct an errors instance of the tag
    TestBean target = new TestBean();
    target.setName("Rob Harrop");
    Errors errors = new BeanPropertyBindingResult(target, COMMAND_NAME);
    errors.rejectValue("name", "some.code", "Default <> Message");
    errors.rejectValue("name", "too.short", "Too & Short");

    exposeBindingResult(errors);

    int result = this.tag.doStartTag();
    assertEquals(BodyTag.EVAL_BODY_BUFFERED, result);
View Full Code Here

Examples of org.springframework.validation.Errors.rejectValue()

    // construct an errors instance of the tag
    TestBean target = new TestBean();
    target.setName("Rob Harrop");
    Errors errors = new BeanPropertyBindingResult(target, COMMAND_NAME);
    errors.rejectValue("name", "some.code", "Default <> Message");
    errors.rejectValue("name", "too.short", "Too & Short");

    exposeBindingResult(errors);

    int result = this.tag.doStartTag();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.