Example usage for org.springframework.validation BindingResult hasErrors

List of usage examples for org.springframework.validation BindingResult hasErrors

Introduction

In this page you can find the example usage for org.springframework.validation BindingResult hasErrors.

Prototype

boolean hasErrors();

Source Link

Document

Return if there were any errors.

Usage

From source file:cherry.example.web.form.ex10.FormEx10ControllerImpl.java

private boolean hasErrors(FormEx10Form form, BindingResult binding) {

    // ??//w  ww  .  j a v a  2  s . com
    if (binding.hasErrors()) {
        return true;
    }

    // ?

    // ??

    return false;
}

From source file:cherry.example.web.form.ex20.FormEx20ControllerImpl.java

private boolean hasErrors(FormEx20Form form, BindingResult binding) {

    // ??//from   w ww  . ja  v  a 2 s .c  om
    if (binding.hasErrors()) {
        return true;
    }

    // ?

    // ??

    return false;
}

From source file:cherry.example.web.form.ex30.FormEx30ControllerImpl.java

private boolean hasErrors(FormEx30Form form, BindingResult binding) {

    // ??//from w w  w .j a v  a 2 s.  c o m
    if (binding.hasErrors()) {
        return true;
    }

    // ?

    // ??

    return false;
}

From source file:cherry.example.web.form.ex40.FormEx40ControllerImpl.java

private boolean hasErrors(FormEx40Form form, BindingResult binding) {

    // ??//from  w w  w  . j  a v  a 2s  .com
    if (binding.hasErrors()) {
        return true;
    }

    // ?

    // ??

    return false;
}

From source file:cherry.example.web.form.ex50.FormEx50ControllerImpl.java

private boolean hasErrors(FormEx50Form form, BindingResult binding) {

    // ??/*from w ww. j a  va  2  s  .  co  m*/
    if (binding.hasErrors()) {
        return true;
    }

    // ?

    // ??

    return false;
}

From source file:ems.emsystem.controller.EmployeeController.java

@RequestMapping(value = "/add", method = RequestMethod.POST)
public String addNewEmployee(@Valid Employee emp, BindingResult bindingResult, Model model) {

    if (bindingResult.hasErrors()) {
        List<Department> depList = departmentService.getDepartments();
        model.addAttribute("departments", depList);
        return "newEmployee";

    }/* ww w .  j a va2  s  .  c o  m*/
    long id = employeeService.addNewEmployee(emp);
    return "redirect: /" + id;
}

From source file:cherry.example.web.validation.ex10.ValidationEx10ControllerImpl.java

private boolean hasErrors(ValidationEx10Form form, BindingResult binding) {

    // ??//from  w w w  .  j a  va  2  s  .c om
    if (binding.hasErrors()) {
        return true;
    }

    // ?

    // ??

    return false;
}

From source file:cherry.example.web.validation.ex20.ValidationEx20ControllerImpl.java

private boolean hasErrors(ValidationEx20Form form, BindingResult binding) {

    // ??//from w w  w .j a  v a2s . c om
    if (binding.hasErrors()) {
        return true;
    }

    // ?

    // ??

    return false;
}

From source file:cherry.example.web.validation.ex30.ValidationEx30ControllerImpl.java

private boolean hasErrors(ValidationEx30Form form, BindingResult binding) {

    // ??//w  w w.  j  av  a2s. c om
    if (binding.hasErrors()) {
        return true;
    }

    // ?

    // ??

    return false;
}

From source file:com.kazuki43zoo.jpetstore.ui.controller.MyOrderController.java

@PostMapping(path = "/create", params = "confirm")
public String createConfirm(@Validated OrderForm form, BindingResult result, Model model) {
    if (result.hasErrors()) {
        model.addAttribute(new Messages().error("Input values are invalid. Please confirm error messages."));
        return "order/orderShippingForm";
    }/*ww  w . ja  va 2  s .  com*/
    return "order/orderConfirm";
}