@ModelAttribute("registerCustomerForm") public RegisterCustomerForm initCustomerRegistrationForm() { RegisterCustomerForm customerRegistrationForm = new RegisterCustomerForm(); Customer customer = customerService.createNewCustomer(); customerRegistrationForm.setCustomer(customer); return customerRegistrationForm; }
customer = customerService.createNewCustomer(); if (BLCRequestUtils.isOKtoUseSession(request)) { request.setAttribute(getAnonymousCustomerSessionAttributeName(), customer, WebRequest.SCOPE_GLOBAL_SESSION);
@ModelAttribute("registerCustomerForm") public RegisterCustomerForm initCustomerRegistrationForm() { RegisterCustomerForm customerRegistrationForm = new RegisterCustomerForm(); Customer customer = customerService.createNewCustomer(); customerRegistrationForm.setCustomer(customer); return customerRegistrationForm; }
public Customer createAnonymousCustomer() throws DataAccessException { Customer customer = customerService.createNewCustomer(); customer.setUsername(String.valueOf(customer.getId())); customer.setPassword(RandomStringUtils.randomAscii(8)); return customerService.saveCustomer(customer); }
customer = customerService.createNewCustomer(); if (BLCRequestUtils.isOKtoUseSession(request)) { request.setAttribute(getAnonymousCustomerSessionAttributeName(), customer, WebRequest.SCOPE_GLOBAL_SESSION);