Esempio n. 1
0
  @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;
  }
Esempio n. 2
0
  @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;
  }