private ICustomerService customerService;
@SuppressWarnings("deprecation")
@RequestMapping(value = {"*", ""}, method = RequestMethod.GET)
public String homeController(ModelMap modelMap) {
Customer customer = null;
if(modelMap.containsKey("customer") && modelMap.get("customer") instanceof Customer) {
customer = (Customer) modelMap.get("customer");
} else {
customer = customerService.getCurrentCustomer();
}
if(customer != null) {
log.info("Customer found, login: " + customer.getLogin());
modelMap.addAttribute(customer);
modelMap.addObject(customer);
} else {
log.info("Customer was not found, add new instance customer to the session");
}