Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @PostMapping("/addProduct")
- public String add2(@ModelAttribute Product product,
- Integer amount,
- Model model){
- ProductToShoppingCart productToShoppingCart=new ProductToShoppingCart();
- productToShoppingCart.setProduct(product);
- productToShoppingCart.setAmount(amount);
- shoppingCart.addProductToShoppingCart(productToShoppingCart);
- model.addAttribute("productAdded", true);
- return "index";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement