I have the following code:使用JSF for <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