@RequestMapping("/") public String loadCustomerForHome( Principal principal, ModelMap modelMap, HttpSession httpSession) { Long currentOrderId = (Long) httpSession.getAttribute("currentOrder"); if (currentOrderId != null) { return "redirect:/continueOrder"; } String email = principal.getName(); Customer currentCustomer = customerRepository.findByEmail(email); modelMap.addAttribute("currentCustomer", currentCustomer); modelMap.addAttribute("stores", storeRepository.findAll()); modelMap.addAttribute( "currentOrders", orderService.loadCurrentOrdersForCustomer(currentCustomer)); return "home"; }