Commit 74c23399 by Patryk Czarnik

wzmianka o model.addAttribute

parent 05c673c5
...@@ -118,6 +118,7 @@ public class ProductController { ...@@ -118,6 +118,7 @@ public class ProductController {
if(bindingResult.hasErrors()) { if(bindingResult.hasErrors()) {
System.err.println("Są błędy: " + bindingResult.getAllErrors()); System.err.println("Są błędy: " + bindingResult.getAllErrors());
// normalnie wyświetlilibyśmy coś na stronie... // normalnie wyświetlilibyśmy coś na stronie...
// model.addAttribute("errors", bindingResult.getAllErrors());
// ale robi to za nas tag f:form i f:errors // ale robi to za nas tag f:form i f:errors
// Dopóki są błędy, pozostajemy na stronie formularza. // Dopóki są błędy, pozostajemy na stronie formularza.
return "product_form"; return "product_form";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment