Code example for ServletWebRequest

0
    @Resource(name = "blCustomerStateRequestProcessor") 
    protected CustomerStateRequestProcessor customerStateRequestProcessor; 
     
    @Override 
    public void execute(HttpServletRequest request, HttpServletResponse response, Authentication authResult) { 
        execute(new ServletWebRequest(request, response), authResult); 
    } 
     
    @Override 
    public void execute(WebRequest request, Authentication authResult) { 
        Customer loggedInCustomer = customerService.readCustomerByUsername(authResult.getName()); 
        Customer anonymousCustomer = customerStateRequestProcessor.getAnonymousCustomer(request); 
         
        Order cart = null; 
        if (anonymousCustomer != null) { 
            cart = orderService.findCartForCustomer(anonymousCustomer); 
        } 
        MergeCartResponse mergeCartResponse; 
        try { 
            mergeCartResponse = mergeCartService.mergeCart(loggedInCustomer, cart);