@RequestMapping("save")
 public String save(@ModelAttribute Product product, BindingResult bindingResult, Model model) {
   if (bindingResult.hasErrors()) {
     model.addAttribute("product", product);
     return "editProduct";
   }
   catalog.addProduct(product);
   return "redirect:/product/list";
 }
  @RequestMapping("add")
  public String add(@ModelAttribute Product product, BindingResult bindingResult, Model model) {
    if (bindingResult.hasErrors()) {
      model.addAttribute("errorMessage", "price must be a number");
      return "newProduct";
    }

    catalog.addProduct(product);

    return "redirect:/product/list";
  }