title: Can i display reference products with gallery images in Hybris?
body: <p>Can i display reference products with gallery images in hybris?</p>
  
  <p>I am trying to retrieve images from controller but value in jsp page is always empty</p>
  
  <pre><code>@RequestMapping(value = PRODUCT_CODE_PATH_VARIABLE_PATTERN, method = RequestMethod.GET)
      public String productDetail(@PathVariable("productCode") final String productCode, final Model model,
              final HttpServletRequest request, final HttpServletResponse response) throws CMSItemNotFoundException,
              UnsupportedEncodingException
      {
          final ProductModel productModel = productService.getProductForCode(productCode);
          final String redirection = checkRequestUrl(request, response, productModelUrlResolver.resolve(productModel));
          if (StringUtils.isNotEmpty(redirection))
          {
              return redirection;
          }
  
          updatePageTitle(productModel, model);
          populateProductDetailForDisplay(productModel, model, request);
          model.addAttribute(new ReviewForm());
          final List&lt;ProductReferenceData&gt; productReferences = productFacade.getProductReferencesForCode(productCode,
                  Arrays.asList(ProductReferenceTypeEnum.SIMILAR, ProductReferenceTypeEnum.ACCESSORIES),
                  Arrays.asList(ProductOption.BASIC, ProductOption.PRICE, ProductOption.GALLERY), null);
  
          try
          {
              for (int i = 0; i &lt; productReferences.size(); i++)
              {
                  final List&lt;Map&lt;String, ImageData&gt;&gt; imageDataList = getGalleryImages(productReferences.get(i).getTarget());
                  final List&lt;ImageData&gt; imdData = new ArrayList&lt;ImageData&gt;();
                  for (int j = 0; j &lt; imageDataList.size(); j++)
                  {
  
                      final ImageData sgImage = imageDataList.get(j).get("product");
                      if (sgImage != null)
                      {
                          imdData.add(sgImage);
                      }
                  }
                  productReferences.get(i).setPreviewImages(imdData);
              }
          }
          catch (final Exception e)
          {
              e.printStackTrace();
          }
  
          //model.addAttribute("imageDataList", imageDataList);
          model.addAttribute("productReferences", productReferences);
          model.addAttribute("pageType", PageType.PRODUCT.name());
  
          final String metaKeywords = MetaSanitizerUtil.sanitizeKeywords(productModel.getKeywords());
          final String metaDescription = MetaSanitizerUtil.sanitizeDescription(productModel.getDescription());
          setUpMetaData(model, metaKeywords, metaDescription);
          return getViewForPage(model);
      }
  </code></pre>
  
  <p>I have extended the product reference data class and added a new property</p>
  
  <pre><code>&lt;bean
          class="de.hybris.platform.commercefacades.product.data.ProductReferenceData"&gt;
          &lt;property name="previewImages"
              type="java.util.List&amp;lt;de.hybris.platform.commercefacades.product.data.ImageData&gt;" /&gt;
      &lt;/bean&gt;
  </code></pre>
  
  <p>Finally in the jsp page i am trying to display it</p>
  
  <pre><code>&lt;section class="featured-products"&gt;
  
              &lt;h4&gt;${component.title}&lt;/h4&gt;
              &lt;div class="features-product-block"&gt;
                  &lt;div class="features-product carousel jcarousel-skin"&gt;
  
                      &lt;c:forEach end="${component.maximumNumberProducts}"
                          items="${productReferences}" var="productReference"&gt;
  
                          &lt;c:url value="${productReference.target.url}/quickView"
                              var="productQuickViewUrl" /&gt;
  
                          &lt;div class="items"&gt;
                              &lt;div class="each-product"&gt;
                                  &lt;div id="featuredprimaryPhoto" class="detailsPhotoWrap"&gt;
                                      &lt;a href="${productQuickViewUrl}" class="popup scrollerProduct"&gt;
                                          &lt;div class="thumb"&gt;
                                              &lt;product:productPrimaryImage
                                                  product="${productReference.target}" format="product" /&gt;
                                          &lt;/div&gt;
  
                                          &lt;h5&gt;
                                              &lt;c:if test="${component.displayProductTitles}"&gt;
                                                  &lt;span&gt;${productReference.target.name}&lt;/span&gt;
                                              &lt;/c:if&gt;
                                          &lt;/h5&gt; &lt;c:if test="${component.displayProductPrices}"&gt;
                                              &lt;p&gt;
                                                  &lt;format:fromPrice
                                                      priceData="${productReference.target.price}" /&gt;
                                              &lt;/p&gt;
                                          &lt;/c:if&gt;
                                      &lt;/a&gt;
  
                                  &lt;/div&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                          &lt;div id="FeaturedShowcase"&gt;
                      &lt;ul class="wtf"&gt;
  
                          &lt;c:forEach items="${productReferences.previewImages}"  var="previewImages"
                              varStatus="varStatus"&gt;
                              &lt;li&gt;Hello&lt;/li&gt;
                          &lt;/c:forEach&gt;
  
  
                      &lt;/ul&gt;
                  &lt;/div&gt;
                      &lt;/c:forEach&gt;
                  &lt;/div&gt;
  
              &lt;/div&gt;
  
          &lt;/section&gt;
  </code></pre>
  
  <p>I am always getting this exception</p>
  
  <p>WARN  [hybrisHTTP12] [DefaultCMSComponentRendererRegistry] Error processing component tag. currentComponent [ProductReferencesComponentModel (8796119335996)] exception: An exception occurred processing JSP page /WEB-INF/views/desktop/cms/productreferencescomponent.jsp at line 76</p>
  
  <pre><code>73:                     &lt;ul class="wtf"&gt;
  74:                     
  75:                     &lt;%-- &lt;product:similarProductImagePanel similarProductImageList="${productReferences.previewImages}"/&gt; --%&gt;
  76:                         &lt;c:forEach items="${productReferences.previewImages}"  var="previewImages"
  77:                             varStatus="varStatus"&gt;
  78:                             &lt;li&gt;Hello&lt;/li&gt;
  79:                         &lt;/c:forEach&gt;
  
  
  Stacktrace:
  </code></pre>
  
  <p>Any help on this issue or any suggestion</p>