3 Replies Latest reply: Mar 28, 2012 12:16 AM by D.N.R RSS

    Unable to display Media-Internal Image in JSP Page

    D.N.R
      Hi All,

      I added several images(media-internal) to my products in BCC. Deployed projects successfully and able to view them in Production ACC.

      Now I'm trying to display them(Product Images) in my jsp. For this I used the following code,

      <dsp:getvalueof id="img13" param="product.largeImage.url" idtype="java.lang.String">
      <dsp:img src=<%=img13%"/>
      </dsp:getvalueof>

      But It didn't work. Code <dsp:valueof param="product.largeImage.url" /> displays <Media-Folder-Name>/<Image-Name>.jpg in jsp page.

      Is there any procedure to display media-internal images ?

      Please help me to resolve the issue.

      Thanks,
      Kushal.

      Edited by: 916721 on Mar 27, 2012 1:42 PM
        • 1. Re: Unable to display Media-Internal Image in JSP Page
          892069
          this seems to be a very old style of coding. what errors are you getting if any?
          try printing the img13 and see if this has got any value or not.
          why dont you get this in a var? try this
          <dspel:getvalueof var="imgUrl" param="product.largeImage.url"/>
          <img src="<c:out value="${imgUrl}"/> alt="img url"/>
          • 2. Re: Unable to display Media-Internal Image in JSP Page
            Praveer.Rai
            Hi Kushal,

            Seems no problem in code.

            Code <dsp:valueof param="product.largeImage.url" /> displays *<Media-Folder-Name>/<Image-Name>.jpg* in jsp page.

            once try hardcoding the value what ever u are getting by using above's product.largeImage.url , and see if image appears eg :

            <img src="*<Media-Folder-Name>/<Image-Name>.jpg*"/> .

            also check if the image exists at following location *<Media-Folder-Name>/<Image-Name>.jpg*

            also in the above code u specified it shold be *<dsp:img src="<%=img13%>"/>*


            ~ Praveer
            • 3. Re: Unable to display Media-Internal Image in JSP Page
              D.N.R
              Hi Praveerraj,

              Thanks for your response. I tried with the code but image is not displayed.

              I found one difference. Path which displayed in JSP and the path of the image for the product in BCC is not the same.

              I tried with the path of the product in BCC in JSP page with img tag. But didn't get the image.

              Please tell where I've done the mistake.

              Thanks,
              Kushal.