@RequestMapping(FoUrls.PERSONAL_ORDER_DETAILS_URL) public ModelAndView removeFromWishlist(final HttpServletRequest request, final Model model) throws Exception { ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice( getCurrentVelocityPath(request), FoUrls.PERSONAL_ORDER_DETAILS.getVelocityPage()); final RequestData requestData = requestUtil.getRequestData(request); final String orderPurchaseId = request.getParameter(RequestConstants.REQUEST_PARAMETER_CUSTOMER_ORDER_GUID); if (StringUtils.isNotEmpty(orderPurchaseId)) { final OrderPurchase orderPurchase = orderPurchaseService.getOrderById(orderPurchaseId); if (orderPurchase != null) { // SANITY CHECK final Customer currentCustomer = requestData.getCustomer(); // WE RELOAD THE CUSTOMER FOR THE PERSISTANCE PROXY FILTER // IT AVOIDS LazyInitializationException: could not initialize proxy - no Session final Customer reloadedCustomer = customerService.getCustomerByLoginOrEmail(currentCustomer.getLogin()); List<OrderPurchase> orderPurchases = orderPurchaseService.findOrdersByCustomerId(reloadedCustomer.getId().toString()); if (orderPurchases.contains(orderPurchase)) { return modelAndView; } else { logger.warn( "Customer, " + reloadedCustomer.getId() + "/" + reloadedCustomer.getEmail() + ", try to acces to a customer order, " + orderPurchaseId + ", which does not belong"); } } } final String url = requestUtil.getLastRequestUrl(request); return new ModelAndView(new RedirectView(url)); }