Class CartController

java.lang.Object
org.mybatis.jpetstore.web.controllers.CartController

@Controller @RequestMapping("/cart") public class CartController extends Object
The Class CartController.
  • Constructor Details

    • CartController

      public CartController()
  • Method Details

    • viewCart

      @GetMapping({"","/"}) public String viewCart(javax.servlet.http.HttpSession session, org.springframework.ui.Model model)
      View cart.
      Parameters:
      session - the session
      model - the model
      Returns:
      the string
    • addItemToCart

      @GetMapping("/addItem") public String addItemToCart(@RequestParam(value="workingItemId",required=false) String workingItemId, javax.servlet.http.HttpSession session, org.springframework.ui.Model model)
      Add item to cart.
      Parameters:
      workingItemId - the working item id
      session - the session
      model - the model
      Returns:
      the string
    • removeItemFromCart

      @GetMapping("/removeItem") public String removeItemFromCart(@RequestParam(value="workingItemId",required=false) String workingItemId, javax.servlet.http.HttpSession session, org.springframework.ui.Model model)
      Remove item from cart.
      Parameters:
      workingItemId - the working item id
      session - the session
      model - the model
      Returns:
      the string
    • updateCartQuantities

      @PostMapping("/update") public String updateCartQuantities(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpSession session, org.springframework.ui.Model model)
      Update cart quantities.
      Parameters:
      request - the request
      session - the session
      model - the model
      Returns:
      the string
    • checkOut

      @GetMapping("/checkout") public String checkOut(javax.servlet.http.HttpSession session, org.springframework.ui.Model model)
      Check out.
      Parameters:
      session - the session
      model - the model
      Returns:
      the string