I have the following code:JSFを使用する<a href="myPicture.png" .../>
<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
どうすればいいですか? ご協力いただきありがとうございます。
'storageAttachment.path'は間違った値を返しています。単純です。フルパス名を返すべきではなく、 'href'として使いたい部分だけを返すべきです。 – EJP
アプリケーションがローカルでのみ使用されている場合は、 'file'プロトコルを使用できます。 –
いいえ、それはローカルだけではありません...私はgalleryPictureThumbnailRequestController.pictureThumbnail(それはタイプのpublic StreamedContent getPictureThumbnail()からリンクに変わります) – internet