Class CartController
java.lang.Object
org.mybatis.jpetstore.web.controllers.CartController
The Class CartController.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddItemToCart(String workingItemId, javax.servlet.http.HttpSession session, org.springframework.ui.Model model) Add item to cart.checkOut(javax.servlet.http.HttpSession session, org.springframework.ui.Model model) Check out.removeItemFromCart(String workingItemId, javax.servlet.http.HttpSession session, org.springframework.ui.Model model) Remove item from cart.updateCartQuantities(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpSession session, org.springframework.ui.Model model) Update cart quantities.viewCart(javax.servlet.http.HttpSession session, org.springframework.ui.Model model) View cart.
-
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 sessionmodel- 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 idsession- the sessionmodel- 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 idsession- the sessionmodel- 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 requestsession- the sessionmodel- 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 sessionmodel- the model- Returns:
- the string
-