@RequestMapping(value = "/shop/{id}/products") public String productAll(@PathVariable("id") String shopId, Model model, HttpServletRequest req) { Shop shop = shopService.load(shopId); List<Product> products = productService.listProducts(shop.getId()); model.addAttribute("shop", shop); model.addAttribute("products", products); ShopStyle shopStyle = shopService.loadShopStyle(shopId); List<String> bodyClasses = new ArrayList<String>(); bodyClasses.add(shopStyle.getAvatarStyle()); bodyClasses.add(shopStyle.getBackgroundColor()); bodyClasses.add(shopStyle.getFontColor()); bodyClasses.add(shopStyle.getFontFamily()); bodyClasses.add( StringUtils.isEmpty(shopStyle.getListView()) ? "smallimg" : shopStyle.getListView()); model.addAttribute("styles", StringUtils.join(bodyClasses, " ")); model.addAttribute("waterfall", "waterfall".equalsIgnoreCase(shopStyle.getListView())); return "shop/shopAll"; }