0

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.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
internet
  • 385
  • 1
  • 8
  • 27
  • `storageAttachment.path` is returning the wrong value, simple as that. It should not return a full path name, only the part that you want to use as the `href`. – user207421 Jul 18 '16 at 23:26
  • If your application is used locally only, you could use the `file` protocol. – Jasper de Vries Jul 19 '16 at 15:11
  • No, it´s not only locally.... How can I change the galleryPictureThumbnailRequestController.pictureThumbnail (it´s from the type public StreamedContent getPictureThumbnail() to a link? – internet Jul 19 '16 at 18:27

1 Answers1

0

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.
Community
  • 1
  • 1
Esteban Rincon
  • 2,040
  • 3
  • 27
  • 44
  • I try to create a component like this: https://github.com/blueimp/Gallery/blob/master/README.md But it seems I need the URL of the picture in href or do you have any other ideas? – internet Jul 30 '16 at 08:15