Here's my method for processing the taco, I return to the design view if there's an error found.
@PostMapping
public String processTaco(@Valid Taco taco, Errors errors, @ModelAttribute TacoOrder tacoOrder)
{
if (errors.hasErrors())
{
return "design";
}
...
}
, and here's my taco class
public class Taco {
@NotNull
@Size(min = 5, message = "Name must be at least 5 characters long")
private String name;
...
}
I sent a empty taco as a test and it failed to catch the error in ver 3.0.6. It says 0 errors were catched. I then changed the version of spring-boot-starter-parent to 2.5.3 in pom.xml and it worked. It said 2 errors were catched. I am a beginner in spring and I am not sure if this is a bug. I only changed the version of spring-boot-starter-parent and nothing else. I rebuild the dependencies using maven though.