internet
internet

Reputation: 385

Using JSF for <a href="myPicture.png" .../>

I have the following code:

 <div id="links" class="links">
     <ui:repeat var="storageAttachment"
        value="#{gallerySlideshowController.selectedStorageAttachmentList}"
        varStatus="status">

                 <a
                    href="https://farm9.static.flickr.com/8839/27742500683_1da5eca775_b.jpg"
                    title="Banana"> <p:graphicImage
                       title="#{storageAttachment.name}" cache="true"
                       value="#{galleryPictureThumbnailRequestController.pictureThumbnail}"
                       rendered="#{galleryPictureThumbnailRequestController.pictureThumbnail != null}">
                       <f:param name="id" value="#{storageAttachment.uniqueId}" />
                    </p:graphicImage>
                 </a>
     </ui:repeat>

How can I replace the link in <a href="https://farm9.static.flickr.com/8839/27742500683_1da5eca775_b.jpg" to my picture path? I have stored the path on my local PC for every storageAttachment item. For example: Object1: storageAttachment.path = C:/mypicture.png

So I need something like: href="#{storageAttachment.path}" -> But this is also not correct because I got http://C:/mypicture.png

How can I do this? Thank you for every help.

Upvotes: 0

Views: 100

Answers (1)

Esteban Rincon
Esteban Rincon

Reputation: 2110

Your PictureThumnailRequestcontroller.pictureThumbnail is StreamedContend, there are no href methods or getHref or anything like that but, you can get the image's InpuStream via pictureThumbnail.getStream(). I suppose what your trying to achieve is to render the image but bigger?

  1. So maybe try a simple Servlet to render the image
  2. Use Omnifaces to render with better ease.

Upvotes: 0

Related Questions