@RequestMapping(value = "/add", method = RequestMethod.GET) public ModelAndView goAdd(Product product) { ModelAndView mav = new ModelAndView("admin/product/edit"); mav.addObject("productCategories", productCategoryService.findAll()); return mav; }
@RequestMapping(value = "/modify", method = RequestMethod.GET) public ModelAndView goModify(@RequestParam long productId, Product product) { ModelAndView mav = new ModelAndView("admin/product/edit"); product = productService.getProductById(productId); mav.addObject("product", product); mav.addObject("productCategories", productCategoryService.findAll()); return mav; }